Enable Just-In-Time compilation of expressions.
At a glance
| Property | Value |
|---|---|
| Parameter | jit |
| Category | planner">Query Planner |
| Default | on |
| Value type | boolean / enum / numeric |
| Change scope | Per-session (SET) |
What it does
When on, PostgreSQL JIT-compiles expression evaluation and Tuple deforming">tuple deforming for queries whose estimated cost exceeds jit_above_cost. On by default since PG12 (when built with LLVM).
How to apply a change
Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.
Inspect the current value and source with SHOW jit; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'jit';.
Tuning guidance
Helps long analytical queries but adds compile overhead that can hurt many short OLTP queries that misjudge cost. If you see latency spikes on cheap queries, set jit = off for that workload or raise jit_above_cost.