jit
Whether queries may be compiled with LLVM JIT.
- 默认
on- Range
- on, off
- Restart needed
- 否
- Default checked on
- PostgreSQL 18
作用
JIT kicks in only for queries whose estimated cost exceeds jit_above_cost (100000). It helps long CPU-bound analytic queries and often hurts short ones, where compile time dominates.
默认值
on. on since PostgreSQL 12 (off in 11). Has no effect if the server was built without LLVM.
Check the current value
SHOW jit; SELECT setting, unit, boot_val, context, source, pending_restart FROM pg_settings WHERE name = 'jit';
Change it
SET jit = off; -- this session ALTER ROLE reporting SET jit = off; -- new sessions of one role ALTER SYSTEM SET jit = off; SELECT pg_reload_conf();
No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).
When to change it
Turn it off for OLTP roles if EXPLAIN ANALYZE shows JIT time in the hundreds of milliseconds on queries that are otherwise fast.
What can go wrong
Off makes long analytic queries somewhat slower.
Questions about jit
What is the default value of jit in PostgreSQL?
on. on since PostgreSQL 12 (off in 11). Has no effect if the server was built without LLVM.
Does changing jit require a restart?
No. No restart. Any role can SET it for a session or with SET LOCAL for one transaction; a server-wide ALTER SYSTEM change applies after a reload (context is user).
When should I change jit?
Turn it off for OLTP roles if EXPLAIN ANALYZE shows JIT time in the hundreds of milliseconds on queries that are otherwise fast.
Back to all PostgreSQL settings, or check the PostgreSQL manual for every option.
Check jit on your own server
SQLly runs the query above against PostgreSQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.