Remix.run Logo
_flux 7 hours ago

Write the binary to a file, call it `libquery-id1234.so`, and link that to whichever processes that need it?

vladich 3 hours ago | parent | next [-]

Won't work well if it executes 20k+ queries per second. Filesystem will be a bottleneck among other things.

SigmundA 3 hours ago | parent | prev [-]

Might want to take a look at some research like this [1] that goes over the issues:

"This obvious drawback of the current software architecture motivates our work: sharing JIT code caches across applications. During the exploration of this idea, we have encountered several challenges. First of all, most JIT compilers leverage both runtime context and profile information to generate optimized code. The compiled code may be embedded with runtime-specific pointers, simplified through unique class-hierarchy analysis, or inlined recursively. Each of these "improve- ments" can decrease the shareability of JIT compiled code."

Anythings doable here with enough dev time. Would be nice if PG could just serialize the query plan itself maybe just as an SO along with non-process specific executable code that then has to be dynamically linked again in other processes.

1. https://dl.acm.org/doi/10.1145/3276494