# jit_inline_above_cost

> jit_inline_above_cost — Perform JIT inlining if query is more expensive. Observed in PG11–19 Beta 3; its last measured boot default is 500000 in PG19 Beta 3, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
---

> [!NOTE]
> **Fact — official short description:** “Perform JIT inlining if query is more expensive.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `real` | Upstream pg_settings type |
| Context | `user` | Settable by an ordinary user |
| Unit | — | Raw unit |
| Range | `-1` – `1.79769e+308` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Query Tuning / Planner Cost Constants | Upstream classification |
| Latest boot value | `500000` | 500000 |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG11 |
| Present in | PG11–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`9370462e9a79`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9370462e9a79755aea367c62eb0fef96f0c42258) — Add inlining support to LLVM JIT provider. |
| Commit date | 2018-03-28 |
| Discussion | [thread 1](https://postgr.es/m/20170901064131.tazjxwus3k2w3ybh@alap3.anarazel.de) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG11–19 Beta 3 | `500000` | — | 500000 |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

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.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| 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. |
| 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. |
| Small nodes | 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. |
{.full-width}

## Pigsty {#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 | — | — |
{.full-width}

> [!CAUTION]
> **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 {#common-pitfalls}

- 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.

## Related parameters {#related-parameters}

[`jit`](/parameters/jit/) · [`jit_above_cost`](/parameters/jit-above-cost/) · [`jit_optimize_above_cost`](/parameters/jit-optimize-above-cost/) · [`jit_expressions`](/parameters/jit-expressions/)

## References {#references}

- [PostgreSQL 19 Beta 3 — jit_inline_above_cost](https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-JIT-INLINE-ABOVE-COST)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
