Better JIT for Postgres
vladich
143 points
72 comments
March 04, 2026
Related Discussions
Found 5 related stories in 49.0ms across 3,471 title embeddings via pgvector HNSW
- Google Cloud: Investing in the Future of PostgreSQL kevincox · 23 pts · April 01, 2026 · 56% similar
- What's new in Linux kernel for PostgreSQL erthalion · 21 pts · March 03, 2026 · 56% similar
- Postgres Traffic Control samlambert · 17 pts · March 23, 2026 · 55% similar
- Postgres with Builtin File Systems ngaut · 54 pts · March 14, 2026 · 52% similar
- TigerFS – A Filesystem Backed by PostgreSQL hahahacorn · 18 pts · March 18, 2026 · 47% similar
Discussion Highlights (8 comments)
eru
> However, standard LLVM-based JIT is notoriously slow at compilation. When it takes tens to hundreds of milliseconds, it may be suitable only for very heavy, OLAP-style queries, in some cases. I don't know anything here, but this seems like a good case for ahead of time compilation? Or at least caching your JIT results? I can image much of the time, you are getting more or less the same query again and again?
asah
awesome! I wonder if it's possible to point AI at this problem and synthesize a bespoke compiler (per-architecture?) for postgresql expressions?
fabian2k
The last time I looked into it my impression was that disabling the JIT in PostgreSQL was the better default choice. I had a massive slowdown in some queries, and that doesn't seem to be an entirely unusual experience. It does not seem worth it to me to add such a large variability to query performance by default. The JIT seemed like something that could be useful if you benchmark the effect on your actual queries, but not as a default for everyone.
sourcegrift
We have everything optimized, and yet somehow DB queries need to be "interpreted" at runtime. There's no reason for DB queries to not be precompiled.
larodi
sadly, no windows version yet AFAICT
swaminarayan
Have you tested this under high concurrency with lots of short OLTP queries? I’m curious whether the much faster compile time actually moves the point where JIT starts paying off, or if it’s still mostly useful for heavier queries.
the_biot
What sort of things are people doing in their SQL queries that make them CPU bound? Admittedly I'm a meat-and-potatoes guy, but I like mine I/O bound. Really amazed to see not one but several generic JIT frameworks though, no idea that was a thing.
hinkley
I’m always surprised to learn LLVM is so slow given that was one of the original motivations for developing it. I don’t know if that’s down to feature creep or intrinsic complexity being higher than people presumed was the case for GCC.