Configuration parameter

cpu_index_tuple_cost — PostgreSQL configuration parameter

Category Query Planning Default 0

Sets the planner’s estimate of the cost of processing each index entry during an index scan.

At a glance

Property Value
Parameter cpu_index_tuple_cost
Category Query Planning
Default 0.005
Value type floating point
Change scope Per-session (SET)
Available in PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12)

What it does

Sets the planner’s estimate of the cost of processing each index entry during an index scan. The default is 0.005.

(Description quoted from the official PostgreSQL documentation.)

How to apply a change

Can be set per session with SET, per role/database with ALTER ROLE/DATABASE ... SET, or globally in postgresql.conf.

Inspect the current value and source with SHOW cpu_index_tuple_cost; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'cpu_index_tuple_cost';.

Tuning guidance

Bump it slightly alongside cpu_operator_cost when index-only and index scans look artificially cheap versus reality. Treat the cost constants as a set and tune them together rather than in isolation.

Reference

PostgreSQL documentation — cpu_index_tuple_cost.

Keep going

Related & next steps

Was this helpful?

← All configuration parameters