seq_page_cost
Read PG 18 manual ↗Sets the planner's estimate of the cost of a disk page fetch that is part of a series of sequential fetches.
- Type
- real
- Context
- user
- Measured default
- 1
- Unit
- —
- Metadata snapshot
- 18
Definition PG 18 manual
Sets the planner's estimate of the cost of a disk page fetch that is part of a series of sequential fetches. The default is 1.0. This value can be overridden for tables and indexes in a particular tablespace by setting the tablespace parameter of the same name (see ALTER TABLESPACE).
Measured default history
| Version interval | Default |
|---|---|
| 9.0 – 19 | 1 |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
seq_page_cost models a sequential page fetch and the conventional base of the planner's arbitrary cost scale. 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 seq_page_cost together with the related cost model and validate the full scan/join/aggregate mix.
OLTP: Calibrate seq_page_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 seq_page_cost.
Version history 1
- PG 9.1 → 9.2changed
Related entries
Further reading
Definition snapshot: english-manuals:eecca40777ac4eb1296206889cc… · English manual source