Better JIT for Postgres

github.com
March 4, 2026
7 min read
🔥🔥🔥🔥🔥
55/100
Summary
pg_jitter is a lightweight JIT compilation provider for PostgreSQL that introduces three alternative JIT backends: sljit, AsmJit, and MIR. It enhances query execution speed and compilation efficiency for PostgreSQL versions 14 to 18, addressing performance issues related to expression-heavy workloads and wide tables.
Key Takeaways
- pg_jitter is a lightweight JIT compilation provider for PostgreSQL that introduces three alternative JIT backends: sljit, AsmJit, and MIR, which offer faster compilation and improved query execution times across PostgreSQL versions 14 to 18.
- The compilation times for pg_jitter backends range from tens of microseconds to single milliseconds, significantly outperforming the default LLVM JIT, which can take tens to hundreds of milliseconds.
- sljit is the most consistent backend, providing 5-25% faster performance than the interpreter across all workloads, while AsmJit is optimized for wide-row and deform-heavy queries, achieving up to 32% faster execution.
- pg_jitter supports runtime backend switching and does not depend on LLVM, allowing for pure C/C++ implementations with small, embeddable libraries.
Coverage & discussions
Hacker News · github.com
Community discussions
Hacker News discussion ↗
Historical count: 5 · 5 saved in sample · Historical sample
Analysis ready
Community Sentiment
Positives
- The exploration of JIT frameworks for PostgreSQL indicates a growing interest in optimizing query performance, which could lead to significant improvements in database efficiency.
- There is potential for AI to contribute to developing bespoke compilers for PostgreSQL, which could tailor optimizations to specific architectures and enhance performance.
Concerns
- The standard LLVM-based JIT is criticized for being slow at compilation, limiting its effectiveness for many queries and suggesting a need for better alternatives.
- Disabling JIT in PostgreSQL has been found to be a better default choice by some users due to significant slowdowns in query performance, raising concerns about its reliability.




