From 065d9440b1f1d2a7799f55f9ac976b6842a6833d Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Thu, 15 Oct 2026 14:20:31 -0400 Subject: [PATCH v1] Show block (not tuple) fetches in EXPLAIN ANALYZE. EXPLAIN ANALYZE showed "Heap Fetches" for index-only scans. This was the number of index entries whose table tuple had to be fetched to check whether they were visible to the scan's MVCC snapshot. Replace this with "Table Block Fetches". This is the number of times that the scan had to switch to a different table block to perform these checks. The number of table accesses that an index-only scan requires is more useful information than the number of individual tuples that had to have their visibility status verified. It is the physical cost of not having the underlying heap pages marked all-visible in the visibility map (not a fuzzy proxy for that cost). Note that each table block fetch corresponds to exactly one ReadBuffer call against the scan's table in all cases. This makes it possible for successive rescans that all happen to only need to examine the same heap page to report only a single table block fetched. Author: Peter Geoghegan --- src/include/executor/instrument_node.h | 4 +- src/backend/access/heap/heapam_indexscan.c | 5 +- src/backend/commands/explain.c | 9 ++- src/backend/executor/nodeBitmapIndexscan.c | 2 +- src/backend/executor/nodeIndexonlyscan.c | 2 +- src/backend/executor/nodeIndexscan.c | 2 +- doc/src/sgml/perform.sgml | 2 +- doc/src/sgml/rules.sgml | 2 +- src/test/isolation/expected/horizons.out | 74 +++++++++---------- src/test/isolation/specs/horizons.spec | 8 +- src/test/regress/expected/memoize.out | 32 ++++---- src/test/regress/expected/partition_prune.out | 4 +- src/test/regress/sql/memoize.sql | 2 +- src/test/regress/sql/partition_prune.sql | 4 +- 14 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/include/executor/instrument_node.h b/src/include/executor/instrument_node.h index 4759a628a..0eb80a3da 100644 --- a/src/include/executor/instrument_node.h +++ b/src/include/executor/instrument_node.h @@ -106,8 +106,8 @@ typedef struct IndexScanInstrumentation /* Index search count (incremented with pgstat_count_index_scan call) */ uint64 nsearches; - /* Table tuples fetched count (incremented during index-only scans) */ - uint64 ntabletuplefetches; + /* Table block fetch count (incremented during index-only scans) */ + uint64 ntableblockfetches; } IndexScanInstrumentation; /* diff --git a/src/backend/access/heap/heapam_indexscan.c b/src/backend/access/heap/heapam_indexscan.c index 49981525c..8ef8e7cd0 100644 --- a/src/backend/access/heap/heapam_indexscan.c +++ b/src/backend/access/heap/heapam_indexscan.c @@ -448,9 +448,6 @@ heapam_index_heap_fetch(IndexScanDesc scan, IndexScanHeapData *hscan, /* Index-only scans only need to verify tuple visibility */ pg_assume(slot == NULL); heapTuple = &tupdata; - - if (scan->instrument) - scan->instrument->ntabletuplefetches++; } /* We can skip the buffer-switching logic if we're on the same page. */ @@ -463,6 +460,8 @@ heapam_index_heap_fetch(IndexScanDesc scan, IndexScanHeapData *hscan, /* We're switching to a new heap block, so count it */ hscan->xs_blkswitch_count++; + if (index_only && scan->instrument) + scan->instrument->ntableblockfetches++; if (BufferIsValid(hscan->xs_cbuf)) ReleaseBuffer(hscan->xs_cbuf); diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 4b1ad4227..83b9903da 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -3905,7 +3905,7 @@ show_indexscan_info(PlanState *planstate, ExplainState *es) Plan *plan = planstate->plan; SharedIndexScanInstrumentation *SharedInfo = NULL; uint64 nsearches = 0, - ntabletuplefetches = 0; + ntableblockfetches = 0; if (!es->analyze) return; @@ -3926,7 +3926,7 @@ show_indexscan_info(PlanState *planstate, ExplainState *es) IndexOnlyScanState *indexstate = ((IndexOnlyScanState *) planstate); nsearches = indexstate->ioss_Instrument->nsearches; - ntabletuplefetches = indexstate->ioss_Instrument->ntabletuplefetches; + ntableblockfetches = indexstate->ioss_Instrument->ntableblockfetches; SharedInfo = indexstate->ioss_SharedInfo; break; } @@ -3950,12 +3950,13 @@ show_indexscan_info(PlanState *planstate, ExplainState *es) IndexScanInstrumentation *winstrument = &SharedInfo->winstrument[i]; nsearches += winstrument->nsearches; - ntabletuplefetches += winstrument->ntabletuplefetches; + ntableblockfetches += winstrument->ntableblockfetches; } } if (nodeTag(plan) == T_IndexOnlyScan) - ExplainPropertyUInteger("Heap Fetches", NULL, ntabletuplefetches, es); + ExplainPropertyUInteger("Table Block Fetches", NULL, + ntableblockfetches, es); ExplainPropertyUInteger("Index Searches", NULL, nsearches, es); } diff --git a/src/backend/executor/nodeBitmapIndexscan.c b/src/backend/executor/nodeBitmapIndexscan.c index 90b010f9b..16bf34cc4 100644 --- a/src/backend/executor/nodeBitmapIndexscan.c +++ b/src/backend/executor/nodeBitmapIndexscan.c @@ -204,7 +204,7 @@ ExecEndBitmapIndexScan(BitmapIndexScanState *node) * which will have a new BitmapIndexScanState and zeroed stats. */ winstrument->nsearches += node->biss_Instrument->nsearches; - Assert(node->biss_Instrument->ntabletuplefetches == 0); + Assert(node->biss_Instrument->ntableblockfetches == 0); } /* diff --git a/src/backend/executor/nodeIndexonlyscan.c b/src/backend/executor/nodeIndexonlyscan.c index b1009027a..5c536ffe5 100644 --- a/src/backend/executor/nodeIndexonlyscan.c +++ b/src/backend/executor/nodeIndexonlyscan.c @@ -261,7 +261,7 @@ ExecEndIndexOnlyScan(IndexOnlyScanState *node) * which will have a new IndexOnlyScanState and zeroed stats. */ winstrument->nsearches += node->ioss_Instrument->nsearches; - winstrument->ntabletuplefetches += node->ioss_Instrument->ntabletuplefetches; + winstrument->ntableblockfetches += node->ioss_Instrument->ntableblockfetches; } /* diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 129d005f1..f268c7d3f 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -820,7 +820,7 @@ ExecEndIndexScan(IndexScanState *node) * which will have a new IndexOnlyScanState and zeroed stats. */ winstrument->nsearches += node->iss_Instrument->nsearches; - Assert(node->iss_Instrument->ntabletuplefetches == 0); + Assert(node->iss_Instrument->ntableblockfetches == 0); } /* diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index ea8da01b7..3e010db9d 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -927,7 +927,7 @@ EXPLAIN ANALYZE SELECT four, unique1 FROM tenk1 WHERE four BETWEEN 1 AND 3 AND u -------------------------------------------------------------------&zwsp;--------------------------------------------------------------- Index Only Scan using tenk1_four_unique1_idx on tenk1 (cost=0.29..6.90 rows=1 width=8) (actual time=0.006..0.007 rows=1.00 loops=1) Index Cond: ((four >= 1) AND (four <= 3) AND (unique1 = 42)) - Heap Fetches: 0 + Table Block Fetches: 0 Index Searches: 3 Buffers: shared hit=7 Planning Time: 0.029 ms diff --git a/doc/src/sgml/rules.sgml b/doc/src/sgml/rules.sgml index 9f9fa978f..a3dd038fd 100644 --- a/doc/src/sgml/rules.sgml +++ b/doc/src/sgml/rules.sgml @@ -1046,7 +1046,7 @@ SELECT count(*) FROM words WHERE word = 'caterpiler'; Aggregate (cost=4.44..4.45 rows=1 width=0) (actual time=0.042..0.042 rows=1.00 loops=1) -> Index Only Scan using wrd_word on wrd (cost=0.42..4.44 rows=1 width=0) (actual time=0.039..0.039 rows=0.00 loops=1) Index Cond: (word = 'caterpiler'::text) - Heap Fetches: 0 + Table Block Fetches: 0 Index Searches: 1 Planning time: 0.164 ms Execution time: 0.117 ms diff --git a/src/test/isolation/expected/horizons.out b/src/test/isolation/expected/horizons.out index 4150b2dee..052261477 100644 --- a/src/test/isolation/expected/horizons.out +++ b/src/test/isolation/expected/horizons.out @@ -25,21 +25,21 @@ Index Only Scan using horizons_tst_data_key on horizons_tst step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_delete: @@ -48,21 +48,21 @@ step pruner_delete: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step ll_commit: COMMIT; @@ -95,21 +95,21 @@ Index Only Scan using horizons_tst_data_key on horizons_tst step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_delete: @@ -118,17 +118,17 @@ step pruner_delete: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- @@ -157,21 +157,21 @@ step ll_start: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_begin: BEGIN; @@ -181,21 +181,21 @@ step pruner_delete: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step ll_commit: COMMIT; @@ -221,21 +221,21 @@ step ll_start: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_delete: @@ -247,21 +247,21 @@ step pruner_vacuum: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step ll_commit: COMMIT; @@ -286,21 +286,21 @@ step ll_start: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- - 2 + 1 (1 row) step pruner_delete: @@ -312,7 +312,7 @@ step pruner_vacuum: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- @@ -322,7 +322,7 @@ step pruner_query: step pruner_query: SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; ?column? -------- diff --git a/src/test/isolation/specs/horizons.spec b/src/test/isolation/specs/horizons.spec index 3f987f943..f629bd003 100644 --- a/src/test/isolation/specs/horizons.spec +++ b/src/test/isolation/specs/horizons.spec @@ -75,14 +75,14 @@ step pruner_vacuum VACUUM horizons_tst; } -# Show the heap fetches of an ordered index-only-scan (other plans -# have been forbidden above) - that tells us how many non-killed leaf -# entries there are. +# Show the table block fetches of an ordered index-only-scan (other plans +# have been forbidden above) - that tells us whether there are any +# non-killed leaf entries. step pruner_query { SELECT explain_json($$ EXPLAIN (FORMAT json, BUFFERS, ANALYZE) - SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Heap Fetches'; + SELECT * FROM horizons_tst ORDER BY data;$$)->0->'Plan'->'Table Block Fetches'; } # Verify that the query plan still is an IOS diff --git a/src/test/regress/expected/memoize.out b/src/test/regress/expected/memoize.out index 2d24f4480..e42e740d1 100644 --- a/src/test/regress/expected/memoize.out +++ b/src/test/regress/expected/memoize.out @@ -22,7 +22,7 @@ begin ln := regexp_replace(ln, 'Evictions: 0', 'Evictions: Zero'); ln := regexp_replace(ln, 'Evictions: \d+', 'Evictions: N'); ln := regexp_replace(ln, 'Memory Usage: \d+', 'Memory Usage: N'); - ln := regexp_replace(ln, 'Heap Fetches: \d+', 'Heap Fetches: N'); + ln := regexp_replace(ln, 'Table Block Fetches: \d+', 'Table Block Fetches: N'); ln := regexp_replace(ln, 'loops=\d+', 'loops=N'); ln := regexp_replace(ln, 'Index Searches: \d+', 'Index Searches: N'); ln := regexp_replace(ln, 'Memory: \d+kB', 'Memory: NkB'); @@ -50,7 +50,7 @@ WHERE t2.unique1 < 1000;', false); Hits: 980 Misses: 20 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N) Index Cond: (unique1 = t2.twenty) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (13 rows) @@ -82,7 +82,7 @@ WHERE t1.unique1 < 1000;', false); Hits: 980 Misses: 20 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1.00 loops=N) Index Cond: (unique1 = t1.twenty) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (13 rows) @@ -154,7 +154,7 @@ WHERE s.c1 = s.c2 AND t1.unique1 < 1000;', false); -> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1.00 loops=N) Filter: ((t1.two + 1) = unique1) Rows Removed by Filter: 9999 - Heap Fetches: N + Table Block Fetches: N Index Searches: N (14 rows) @@ -225,7 +225,7 @@ ON t1.x = t2.t::numeric AND t1.t::numeric = t2.x;', false); -> Index Only Scan using expr_key_idx_x_t on expr_key t2 (actual rows=2.00 loops=N) Index Cond: (x = (t1.t)::numeric) Filter: (t1.x = (t)::numeric) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (11 rows) @@ -269,7 +269,7 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f = f2.f;', false); ---------------------------------------------------------------------------------- Nested Loop (actual rows=4.00 loops=N) -> Index Only Scan using flt_f_idx on flt f1 (actual rows=2.00 loops=N) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Memoize (actual rows=2.00 loops=N) Cache Key: f1.f @@ -277,7 +277,7 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f = f2.f;', false); Hits: 1 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N) Index Cond: (f = f1.f) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (12 rows) @@ -288,7 +288,7 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f >= f2.f;', false); ---------------------------------------------------------------------------------- Nested Loop (actual rows=4.00 loops=N) -> Index Only Scan using flt_f_idx on flt f1 (actual rows=2.00 loops=N) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Memoize (actual rows=2.00 loops=N) Cache Key: f1.f @@ -296,7 +296,7 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f >= f2.f;', false); Hits: 0 Misses: 2 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N) Index Cond: (f <= f1.f) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (12 rows) @@ -362,7 +362,7 @@ SELECT * FROM prt t1 INNER JOIN prt t2 ON t1.a = t2.a;', false); Append (actual rows=32.00 loops=N) -> Nested Loop (actual rows=16.00 loops=N) -> Index Only Scan using iprt_p1_a on prt_p1 t1_1 (actual rows=4.00 loops=N) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Memoize (actual rows=4.00 loops=N) Cache Key: t1_1.a @@ -370,11 +370,11 @@ SELECT * FROM prt t1 INNER JOIN prt t2 ON t1.a = t2.a;', false); Hits: 3 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using iprt_p1_a on prt_p1 t2_1 (actual rows=4.00 loops=N) Index Cond: (a = t1_1.a) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Nested Loop (actual rows=16.00 loops=N) -> Index Only Scan using iprt_p2_a on prt_p2 t1_2 (actual rows=4.00 loops=N) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Memoize (actual rows=4.00 loops=N) Cache Key: t1_2.a @@ -382,7 +382,7 @@ SELECT * FROM prt t1 INNER JOIN prt t2 ON t1.a = t2.a;', false); Hits: 3 Misses: 1 Evictions: Zero Overflows: 0 Memory Usage: NkB -> Index Only Scan using iprt_p2_a on prt_p2 t2_2 (actual rows=4.00 loops=N) Index Cond: (a = t1_2.a) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (25 rows) @@ -396,7 +396,7 @@ ON t1.a = t2.a;', false); ---------------------------------------------------------------------------------------- Nested Loop (actual rows=16.00 loops=N) -> Index Only Scan using iprt_p1_a on prt_p1 t1 (actual rows=4.00 loops=N) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Memoize (actual rows=4.00 loops=N) Cache Key: t1.a @@ -405,11 +405,11 @@ ON t1.a = t2.a;', false); -> Append (actual rows=4.00 loops=N) -> Index Only Scan using iprt_p1_a on prt_p1 (actual rows=4.00 loops=N) Index Cond: (a = t1.a) - Heap Fetches: N + Table Block Fetches: N Index Searches: N -> Index Only Scan using iprt_p2_a on prt_p2 (actual rows=0.00 loops=N) Index Cond: (a = t1.a) - Heap Fetches: N + Table Block Fetches: N Index Searches: N (17 rows) diff --git a/src/test/regress/expected/partition_prune.out b/src/test/regress/expected/partition_prune.out index 3506ecec4..551a4226b 100644 --- a/src/test/regress/expected/partition_prune.out +++ b/src/test/regress/expected/partition_prune.out @@ -2353,8 +2353,8 @@ create table ab_a3_b1 partition of ab_a3 for values in (1); create table ab_a3_b2 partition of ab_a3 for values in (2); create table ab_a3_b3 partition of ab_a3 for values in (3); -- Disallow index only scans as concurrent transactions may stop visibility --- bits being set causing "Heap Fetches" to be unstable in the EXPLAIN ANALYZE --- output. +-- bits being set causing "Table Block Fetches" to be unstable in the EXPLAIN +-- ANALYZE output. set enable_indexonlyscan = off; prepare ab_q1 (int, int, int) as select * from ab where a between $1 and $2 and b <= $3; diff --git a/src/test/regress/sql/memoize.sql b/src/test/regress/sql/memoize.sql index c02a0d51a..bd7e57966 100644 --- a/src/test/regress/sql/memoize.sql +++ b/src/test/regress/sql/memoize.sql @@ -23,7 +23,7 @@ begin ln := regexp_replace(ln, 'Evictions: 0', 'Evictions: Zero'); ln := regexp_replace(ln, 'Evictions: \d+', 'Evictions: N'); ln := regexp_replace(ln, 'Memory Usage: \d+', 'Memory Usage: N'); - ln := regexp_replace(ln, 'Heap Fetches: \d+', 'Heap Fetches: N'); + ln := regexp_replace(ln, 'Table Block Fetches: \d+', 'Table Block Fetches: N'); ln := regexp_replace(ln, 'loops=\d+', 'loops=N'); ln := regexp_replace(ln, 'Index Searches: \d+', 'Index Searches: N'); ln := regexp_replace(ln, 'Memory: \d+kB', 'Memory: NkB'); diff --git a/src/test/regress/sql/partition_prune.sql b/src/test/regress/sql/partition_prune.sql index d6e096dc5..e286973cd 100644 --- a/src/test/regress/sql/partition_prune.sql +++ b/src/test/regress/sql/partition_prune.sql @@ -566,8 +566,8 @@ create table ab_a3_b2 partition of ab_a3 for values in (2); create table ab_a3_b3 partition of ab_a3 for values in (3); -- Disallow index only scans as concurrent transactions may stop visibility --- bits being set causing "Heap Fetches" to be unstable in the EXPLAIN ANALYZE --- output. +-- bits being set causing "Table Block Fetches" to be unstable in the EXPLAIN +-- ANALYZE output. set enable_indexonlyscan = off; prepare ab_q1 (int, int, int) as -- 2.55.0