Plan operator

Index Only Scan

Plan node that returns rows using only the index, skipping the heap entirely when the visibility map allows.

An Index Only Scan answers a query by reading the index alone, without visiting the heap (the actual table pages). PostgreSQL can do this when every column the query needs is present in the index and the visibility map says the involved heap pages are fully visible to all transactions.

The visibility map is updated by VACUUM, so a freshly written or recently updated table will see fewer index-only scans until the next vacuum runs. EXPLAIN ANALYZE reports the savings as "Heap Fetches: N" — the lower, the better.

To get a query off Index Scan and onto Index Only Scan, add the missing columns to the index — either by extending the key, or with INCLUDE to make a covering index that doesn't widen the search structure.