Configuration parameter

jit_above_cost — PostgreSQL configuration parameter

Category Query Planning Default 100000

Sets the query cost above which JIT compilation is activated, if enabled (see jit).

At a glance

Property Value
Parameter jit_above_cost
Category Query Planning
Default 100000
Value type floating point
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Sets the query cost above which JIT compilation is activated, if enabled (see jit). Performing JIT costs planning time but can accelerate query execution. Setting this to -1 disables JIT compilation. The default is 100000.

(Description quoted from the official PostgreSQL documentation.)

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_above_cost; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'jit_above_cost';.

Tuning guidance

Raise it (or set JIT off) if short OLTP statements pay JIT compile time they never recoup; the default 100000 is tuned for long analytical queries. Watch EXPLAIN (ANALYZE, BUFFERS) JIT timing.

Reference

PostgreSQL documentation — jit_above_cost.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters