logoalt Hacker News

SigmundAyesterday at 11:42 AM2 repliesview on HN

Sharing executable code between processes it not as easy as sharing data. AFAIK unless somethings changed recently PG shares nothing about plans between process and can't even share a cached plan between session/connections.


Replies

_fluxyesterday at 1:03 PM

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

llm_nerdyesterday at 12:08 PM

Executable code is literally just data that you mark as executable. It did the JIT code, and the idea that it can't then share it between processes is incomprehensible.

I was actually confused by this submission as it puts so much of an emphasis on initial compilation time, when every DB (apparently except for pgsql) caches that result and shares it/reuses it until invalidation. Invalidation can occur for a wide variety of reasons (data composition changing, age, etc), but still the idea of redoing it on every query, where most DBs see the same queries endlessly, is insane.