Index-Only Scans and Visibility Map
Unlock index-only scans by covering queries and keeping the visibility map up-to-date.
What Is an Index-Only Scan?
Normally, an index lookup returns row IDs (TIDs), and the table must be visited to read the actual row. Index-Only Scan answers the query using the index alone — no heap visit. Hugely faster.
Conditions
Index-Only Scan requires:
- All SELECTed columns must be in the index
- The row's page must be marked "all visible" in the visibility map
All lessons in this course
- MVCC and Bloat Causes
- VACUUM, autovacuum, vacuum_cost_delay
- ANALYZE and pg_statistic
- Index-Only Scans and Visibility Map