jit_inline_above_cost
Read PG 18 manual ↗Sets the query cost above which JIT compilation attempts to inline functions and operators.
- Type
- real
- Context
- user
- Measured default
- 500000
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Sets the query cost above which JIT compilation attempts to inline functions and operators. Inlining adds planning time, but can improve execution speed. It is not meaningful to set this to less than jit_above_cost. Setting this to -1 disables inlining. The default is 500000.
Measured default history
| Version interval | Default |
|---|---|
| 11 – 19 | 500000 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
jit_inline_above_cost compares the finished plan's estimated cost with a threshold to decide whether PostgreSQL may run JIT inlining. The cost is the planner's arbitrary estimate, not milliseconds.
The decision occurs at plan time and only matters when JIT is enabled and a provider is available. Generic prepared plans retain the decision made when the generic plan was generated.
A value of -1 disables this stage. jit_inline_above_cost and jit_optimize_above_cost are additional gates after jit_above_cost, so setting either below the base compilation threshold is not meaningful. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.
Operational considerations
Reading the threshold as milliseconds rather than arbitrary planner cost units.
Ignoring JIT generation, inlining, optimization, and emission time when benchmarking.
Expecting a changed value to alter a generic plan that was already generated.
Setting an advanced-stage threshold below jit_above_cost and expecting that stage to run by itself.
Workload guidance
OLAP: For long CPU-bound queries, benchmark total elapsed time on both sides of jit_inline_above_cost. Lowering the threshold is useful only when saved execution CPU consistently exceeds compilation overhead.
OLTP: Do not lower jit_inline_above_cost globally to chase a single CPU-heavy statement. Compilation latency is visible in short-query tails; test at statement or role scope and include JIT generation time in the result.
SMALL: Keep the default or disable the stage with -1 when LLVM work competes with a small CPU budget. Estimated cost alone does not prove that JIT will pay back its startup cost.
Version history 1
- PG 10 → 11added
Related entries
Further reading
Definition snapshot: english-manuals:d36bc310b22a7832a2d9db4b84c… · English manual source