Parameter · Query Tuning / Other Planner Options
jit
Allow JIT compilation.
- Default:
on - Type: bool
- Applies: Session (any user)
In plain words
JIT compiles parts of a long-running query into machine code so they run faster. PostgreSQL only does it for queries it thinks are expensive. This switch turns the whole feature on or off; when off, queries are always interpreted.
For DBAs and operators
JIT needs a server built with LLVM support and the JIT provider package installed (for example postgresql-18-jit on Debian/Ubuntu or postgresql18-llvmjit on RHEL). SELECT pg_jit_available(); returns true only if the provider (jit_provider, default llvmjit) can be loaded and jit is on; if the provider is missing, JIT silently does nothing.
When on, the cost thresholds decide per query: jit_above_cost to compile, jit_inline_above_cost to inline, jit_optimize_above_cost to optimize; jit_expressions and jit_tuple_deforming choose what is compiled. JIT helps CPU-bound analytics (large aggregates, many expressions over millions of rows) and hurts short queries whose estimated cost is high because of bad estimates.
A frequent support finding is EXPLAIN ANALYZE with a JIT: … Total 150 ms line on a query that runs 20 ms otherwise. Setting jit = off globally is a common, safe choice for OLTP workloads; analytics roles can turn it back on with ALTER ROLE … SET jit = on.
How to change it
Any user can change it for their session with SET.
See it in context
Related parameters
jit_above_cost jit_inline_above_cost jit_optimize_above_cost jit_provider jit_expressions