Problem Statement
Why might an engine fall back to heap lookups even if all projected columns are in the index?
Explanation
Some engines need to confirm row visibility (e.g., via visibility maps) before serving from the index alone. If visibility info is not set, they probe the base table. Regular vacuuming and recent access can improve index-only scans.
Code Solution
SolutionRead Only
-- Postgres example: VACUUM ANALYZE helps visibility maps
Practice Sets
This question appears in the following practice sets:
