DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Query Tuning / Planner Cost Constants

cpu_index_tuple_cost

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

  • Default: 0.005
  • Type: real
  • Range: 0 … 1.79769e+308
  • Applies: Session (any user)

In plain words

Index scans look at index entries before fetching rows. This is the planner's price for handling one such entry, half the cost of handling a table row by default. It slightly changes how attractive index and bitmap scans look.

For DBAs and operators

Charged per index tuple visited by index scans, index-only scans and bitmap index scans, in addition to the page costs for index pages and the cpu_operator_cost for evaluating the index condition. For selective lookups it is a minor term; for scans that visit a large part of an index it can decide between a full index scan and a sequential scan plus sort.

Because index-only scans avoid heap page costs, this value and the visibility-map fraction (pg_class.relallvisible) dominate their cost. Rarely changed in practice; if index plans need to look cheaper, adjusting random_page_cost is the more common and better understood lever.

How to change it

Any user can change it for their session with SET.

See it in context

Planner cost model B-tree indexes

Related parameters

cpu_tuple_cost cpu_operator_cost random_page_cost enable_indexonlyscan

All Query Tuning parameters