cpu_index_tuple_cost
Read PG 18 manual ↗Sets the planner's estimate of the cost of processing each index entry during an index scan.
- Type
- real
- Context
- user
- Measured default
- 0.005
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Sets the planner's estimate of the cost of processing each index entry during an index scan. The default is 0.005.
Measured default history
| Version interval | Default |
|---|---|
| 9.0 – 19 | 0.005 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
cpu_index_tuple_cost models the CPU work to process one index entry during an index scan. It is one term in estimated path cost and does not allocate resources or change executor behavior directly.
Planner cost units are arbitrary and only their ratios matter. Scaling all cost constants together leaves path ordering unchanged; changing one alters the balance between I/O, row processing, operators, and parallel overhead.
The value is consulted when a plan is built. Statistics, row-count estimates, cache assumptions, tablespace overrides, and enabled plan methods can outweigh a small change in this constant. Its user context permits session- or transaction-local changes; newly performed or newly planned work sees the value.
Operational considerations
Interpreting the value as elapsed time or a hard resource limit.
Tuning it to repair one query and regressing the wider workload.
Changing cost constants before correcting statistics and cardinality estimates.
Forgetting that only relative values influence path choice.
Workload guidance
OLAP: Analytical workloads can justify a different CPU-versus-I/O balance, but change cpu_index_tuple_cost together with the related cost model and validate the full scan/join/aggregate mix.
OLTP: Calibrate cpu_index_tuple_cost only from a representative workload, not one plan. First correct stale statistics and compare EXPLAIN (ANALYZE, BUFFERS) estimates with reality; use role or tablespace scope where possible.
SMALL: Keep the upstream value unless repeated evidence shows a systematic modeling error. On small systems, concurrency and cache residency often matter more than fine-grained changes to cpu_index_tuple_cost.
Related entries
Further reading
Definition snapshot: english-manuals:bc8fba8734a37b3c2a0412b1f15… · English manual source