An index-only scan answers a query entirely from index contents, avoiding table-row access when the index contains every required value. PostgreSQL reports this plan node with Heap Fetches: 0. section 4.5.1
Counting scores without table access
After creating idx_score on score, EXPLAIN reports Index Only Scan using idx_score for the score range. The query finds 970 rows in 0.350 ms instead of 1.753 ms with a sequential scan.
Covering a leaderboard filter
A covering index on region, score, and win_count with username included supplies every value for the filtered and ordered query, reducing execution time to 0.602 ms.
QUERY PLAN ------------------------------------------------------------------------ Index Only Scan using idx_composite_covering_index on player_stats ➥ (actual time=0.076..0.497 rows=1580 loops=1) Index Cond: ((region = 'NA'::text) AND (score > 5000) ➥ AND (win_count > 10)) Heap Fetches: 0 Planning Time: 0.320 ms Execution Time: 0.602 ms
Inspect the complete covering-index plan, including its predicates, timing, and Heap Fetches value. section 4.7

