Skip to content
uencoder

Index-Only Scan

An index-only scan returns query results directly from the index without touching the heap, enabled by covering indexes or visibility maps.

Purpose

To eliminate heap-lookup random I/O and significantly speed up SELECT-heavy queries.

Mechanism

If all query columns are in the index and row visibility checks pass (PostgreSQL visibility map), only index pages are read. The visibility map marks whether all rows on a page are visible to the current snapshot, avoiding heap checks of MVCC visibility.

Use cases

  • Query optimization
  • I/O reduction
  • Performance tuning

Related tools

References