Parameter · Query Tuning / Planner Cost Constants
cpu_tuple_cost
Sets the planner's estimate of the cost of processing each tuple (row).
- Default:
0.01 - Type: real
- Range: 0 … 1.79769e+308
- Applies: Session (any user)
In plain words
Every row a plan step handles costs a little CPU. This sets that price, relative to reading one page in order (1.0). The default says 100 rows cost about as much as one page read. Raising it makes plans that handle fewer rows (usually index plans) look better.
For DBAs and operators
Charged once per row output by scans, joins and many other nodes; it is the 2,000 in the 4,273 cost of a 200,000-row Seq Scan. Together with cpu_index_tuple_cost and cpu_operator_cost it forms the CPU side of the cost model.
When the data is fully cached the page costs over-weight I/O, and some DBAs raise the CPU costs (or lower the page costs) to compensate; the effect is the same ratio change. A related use: cpu_tuple_cost influences whether a LIMIT query prefers a fast-start plan, and it is also used for function result rows and CTE scans.
These defaults have not changed in decades and work reasonably on modern hardware, so most installations should leave them alone and tune random_page_cost and effective_cache_size first. Changes affect every query; try them per session with EXPLAIN on representative queries.
How to change it
Any user can change it for their session with SET.
See it in context
Related parameters
cpu_index_tuple_cost cpu_operator_cost seq_page_cost parallel_tuple_cost