jit_expressions
Fact — official short description: “Allow JIT compilation of expressions.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG11 |
| Present in | PG11–19 Beta 3 |
| Removed in | No |
| Introduction commit | 2a0faed9d702 — Add expression compilation support to LLVM JIT provider. |
| Commit date | 2018-03-20 |
| Discussion | thread 1 |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG11–19 Beta 3 | on |
— | on |
How it works
jit_expressions controls whether expression evaluation is JIT compiled after the query has already crossed the top-level JIT cost gate. It does not activate JIT by itself.
Disabling it leaves expressions interpreted while other eligible JIT work can still occur. This isolates expression-code generation for testing correctness or compilation overhead.
The setting is a developer diagnostic rather than the normal way to tune JIT; jit_above_cost and the top-level jit switch govern production selection. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| OLTP | Do not tune production OLTP with jit_expressions. Enable it only for a bounded reproduction with an owner, log/disk budget, rollback condition, and evidence-capture plan; restore the default immediately afterward. |
| OLAP | Long analytical runs can amplify jit_expressions’s debug overhead and artifacts. Prefer standard EXPLAIN and statistics first, and isolate any developer experiment from normal users. |
| Small nodes | Keep jit_expressions at its upstream default. A small host has less spare CPU, disk, connection, and log capacity for developer instrumentation. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG11–19 Beta 3 unmodified; OLAP: PG11–19 Beta 3 unmodified; CRIT: PG11–19 Beta 3 unmodified; TINY: PG11–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common pitfalls
- Leaving jit_expressions enabled after the bounded diagnostic or recovery task.
- Running the experiment on the only copy of production data.
- Underestimating log, core-file, temporary-file, WAL, CPU, or connection-slot amplification.
- Treating a server that merely starts or completes a query as proof that data and behavior are correct.
Related parameters
jit · jit_above_cost · jit_tuple_deforming · jit_inline_above_cost · jit_optimize_above_cost