Index-only scan (PostgreSQL)
A PostgreSQL index-only scan retrieves values from index entries and consults the heap when visibility cannot be established from the visibility map.
The index must support returning the needed values, and the query must be answerable from that index. A covering index can carry extra payload columns through INCLUDE, but that duplicates data and can increase index size. [1]
The plan name does not promise zero heap visits. For a candidate index tuple, a set all-visible map bit permits skipping the heap visibility check. A clear bit requires that check; returned values still come from the index. [1] [3]
In REL_16_15, Heap Fetches counts attempts to fetch a heap tuple for visibility, including attempts that find no visible tuple. It does not count unique pages or physical disk reads, and it is not a checksum-verification counter. [3]
Relations
Citations
- PostgreSQL 16: Index-Only Scans and Covering Indexes
- PostgreSQL REL_16_15: IndexOnlyNext, visibility checks and heap-fetch instrumentation
Further reading
Sources & caveats
- The counter interpretation is scoped to PostgreSQL REL_16_15. The linked Observatory demonstration uses synthetic clean rows, not injected corruption or a disk-I/O benchmark.