One other thing about JIT that I feel is pretty crazy is that the generated code is not cached. I mean it's the most expensive part of the query execution a lot of the time, how come it's not cached?
I couldn't find good reasons for this looking through Postgres mailing lists discussion around JIT.Disabling JIT is the way to go for OLTP workloads.
davidrowley|2 years ago
In particular:
> The immediate goal is to be able to generate JITed code/LLVM-IR that doesn't > contain any absolute pointer values. If the generated code doesn't change > regardless of any of the other contents of ExprEvalStep, we can still cache > the JIT optimization / code emission steps - which are the expensive bits.
A colleague is working on getting this patch into shape. So we might see some caching work get done after the relative pointer work is in.
SigmundA|2 years ago
nextaccountic|2 years ago
You can share stuff with a multiprocess architecture just fine (either through IPC or just plain shared memory + synchronization)
It's true that threads share memory by default, but processes can opt into sharing memory if they wish. And it appears that Postgres already makes use of shared memory for some things
https://www.instaclustr.com/blog/postgresql-docker-and-share...
https://stackoverflow.com/questions/32930787/understanding-p...
(random links from Google just to illustrate the point)
fakwandi_priv|2 years ago
Seems like these will get cached at some point.