jit_above_cost
No restart — settable per sessioncost units; -1 disables JIT
Minimum estimated query cost at which JIT compilation kicks in.
What it does
JIT compilation has its own startup cost, so PostgreSQL only triggers it once the planner's estimated cost reaches this threshold (default 100000). Two further thresholds — jit_inline_above_cost and jit_optimize_above_cost — gate progressively more compiler work.
How to tune it
If short OLTP queries are being JIT-compiled to their detriment (a common symptom of over-estimated query costs), raise jit_above_cost rather than turning JIT off entirely. For analytics where JIT pays off, the default usually works.
FAQ
- Should I raise jit_above_cost or turn jit off?
- Prefer raising jit_above_cost. Off disables compilation across the board; raising the threshold preserves JIT for the genuinely expensive queries that benefit while shielding short queries from its compile-time cost.