1. A method comprising: receiving, by a database system, a query; forming a runtime plan tree corresponding to the query for executing the query, the runtime plan tree comprising a plurality of function nodes corresponding to functions to be executed for executing the query; traversing the runtime plan tree, comprising: determining whether a first function node of the runtime plan tree supports code generation and just-in-time (JIT) compilation; and upon determining that the first function node supports the code generation and JIT compilation, translating a first function of the first function node into a first string key; and determining whether a first compiled object corresponding to the first string key is stored in a compiled object cache, the compiled object cache comprising a plurality of compiled objects corresponding to query functions that have been compiled, and each of the plurality of compiled objects being associated with a string key, wherein each of the plurality of compiled objects is reusable for executing queries that comprise a corresponding query function; and executing the query, comprising executing the first function by directly executing the first compiled object without compiling the first function when the first compiled object is stored in the compiled object cache, and wherein traversing the runtime plan tree further comprises: machine code just-in-time (MCJIT) compiling a low level virtual machine (LLVM) intermediate representation (IR) format function to produce a compiled object, wherein the LLVM IR format function corresponds to a query function; and storing the compiled object in the compiled object cache.