From 377745a752a81b986fa6c0b8f896f418f66b28e4 Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Thu, 15 Oct 2026 14:20:31 -0400 Subject: [PATCH v2] EXPLAIN ANALYZE: Show index-only scan block fetches. EXPLAIN ANALYZE shows "Heap Fetches" for index-only scans. Rename this to the more table AM agnostic "Table Fetches", and display both the number of rows and blocks fetched. 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 (which is how it has always worked for rows fetched). Author: Peter Geoghegan Discussion: https://postgr.es/m/CAH2-Wz=vLkCGiLs-9kB0ubZAUyYnrMu_GN78TJ=u2sVncJeanA@mail.gmail.com --- src/include/executor/instrument_node.h | 3 +- src/backend/access/heap/heapam_indexscan.c | 2 + src/backend/commands/explain.c | 22 +++++++++- src/backend/executor/nodeBitmapIndexscan.c | 1 + src/backend/executor/nodeIndexonlyscan.c | 1 + src/backend/executor/nodeIndexscan.c | 1 + doc/src/sgml/perform.sgml | 2 +- doc/src/sgml/rules.sgml | 2 +- src/test/isolation/expected/horizons.out | 40 +++++++++---------- src/test/isolation/specs/horizons.spec | 4 +- src/test/regress/expected/memoize.out | 32 +++++++-------- src/test/regress/expected/partition_prune.out | 2 +- src/test/regress/sql/memoize.sql | 2 +- src/test/regress/sql/partition_prune.sql | 2 +- 14 files changed, 70 insertions(+), 46 deletions(-) diff --git a/src/include/executor/instrument_node.h b/src/include/executor/instrument_node.h index c48e8ad75..d8d7d548e 100644 --- a/src/include/executor/instrument_node.h +++ b/src/include/executor/instrument_node.h @@ -106,8 +106,9 @@ typedef struct IndexScanInstrumentation /* Index search count (incremented with pgstat_count_index_scan call) */ uint64 nsearches; - /* Table tuples fetched count (incremented during index-only scans) */ + /* Table fetch counts (incremented during index-only scans) */ uint64 ntabletuplefetches; + uint64 ntableblockfetches; } IndexScanInstrumentation; /* diff --git a/src/backend/access/heap/heapam_indexscan.c b/src/backend/access/heap/heapam_indexscan.c index 49981525c..d1ce281c7 100644 --- a/src/backend/access/heap/heapam_indexscan.c +++ b/src/backend/access/heap/heapam_indexscan.c @@ -463,6 +463,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 f778075b9..fa273cf09 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -3977,7 +3977,8 @@ show_indexscan_info(PlanState *planstate, ExplainState *es) Plan *plan = planstate->plan; SharedIndexScanInstrumentation *SharedInfo = NULL; uint64 nsearches = 0, - ntabletuplefetches = 0; + ntabletuplefetches = 0, + ntableblockfetches = 0; if (!es->analyze) return; @@ -4002,6 +4003,7 @@ show_indexscan_info(PlanState *planstate, ExplainState *es) { nsearches = indexstate->ioss_Instrument->nsearches; ntabletuplefetches = indexstate->ioss_Instrument->ntabletuplefetches; + ntableblockfetches = indexstate->ioss_Instrument->ntableblockfetches; } SharedInfo = indexstate->ioss_SharedInfo; break; @@ -4028,11 +4030,27 @@ show_indexscan_info(PlanState *planstate, ExplainState *es) nsearches += winstrument->nsearches; ntabletuplefetches += winstrument->ntabletuplefetches; + ntableblockfetches += winstrument->ntableblockfetches; } } if (nodeTag(plan) == T_IndexOnlyScan) - ExplainPropertyUInteger("Heap Fetches", NULL, ntabletuplefetches, es); + { + if (es->format == EXPLAIN_FORMAT_TEXT) + { + ExplainIndentText(es); + appendStringInfo(es->str, + "Table Fetches: rows=" UINT64_FORMAT " blocks=" UINT64_FORMAT "\n", + ntabletuplefetches, ntableblockfetches); + } + else + { + ExplainPropertyUInteger("Table Row 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..51ca25562 100644 --- a/src/backend/executor/nodeBitmapIndexscan.c +++ b/src/backend/executor/nodeBitmapIndexscan.c @@ -205,6 +205,7 @@ ExecEndBitmapIndexScan(BitmapIndexScanState *node) */ 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..1826c2ce7 100644 --- a/src/backend/executor/nodeIndexonlyscan.c +++ b/src/backend/executor/nodeIndexonlyscan.c @@ -262,6 +262,7 @@ ExecEndIndexOnlyScan(IndexOnlyScanState *node) */ 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..879f1983b 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -821,6 +821,7 @@ ExecEndIndexScan(IndexScanState *node) */ 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..c28bb8f72 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 Fetches: rows=0 blocks=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..910b984e6 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 Fetches: rows=0 blocks=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..feebe09fd 100644 --- a/src/test/isolation/expected/horizons.out +++ b/src/test/isolation/expected/horizons.out @@ -25,7 +25,7 @@ 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 Row Fetches'; ?column? -------- @@ -35,7 +35,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 Row Fetches'; ?column? -------- @@ -48,7 +48,7 @@ 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 Row Fetches'; ?column? -------- @@ -58,7 +58,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 Row Fetches'; ?column? -------- @@ -95,7 +95,7 @@ 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 Row Fetches'; ?column? -------- @@ -105,7 +105,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 Row Fetches'; ?column? -------- @@ -118,7 +118,7 @@ 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 Row Fetches'; ?column? -------- @@ -128,7 +128,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 Row Fetches'; ?column? -------- @@ -157,7 +157,7 @@ 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 Row Fetches'; ?column? -------- @@ -167,7 +167,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 Row Fetches'; ?column? -------- @@ -181,7 +181,7 @@ 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 Row Fetches'; ?column? -------- @@ -191,7 +191,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 Row Fetches'; ?column? -------- @@ -221,7 +221,7 @@ 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 Row Fetches'; ?column? -------- @@ -231,7 +231,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 Row Fetches'; ?column? -------- @@ -247,7 +247,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 Row Fetches'; ?column? -------- @@ -257,7 +257,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 Row Fetches'; ?column? -------- @@ -286,7 +286,7 @@ 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 Row Fetches'; ?column? -------- @@ -296,7 +296,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 Row Fetches'; ?column? -------- @@ -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 Row 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 Row Fetches'; ?column? -------- diff --git a/src/test/isolation/specs/horizons.spec b/src/test/isolation/specs/horizons.spec index 3f987f943..4c6426eca 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 +# Show the table row fetches of an ordered index-only-scan (other plans # have been forbidden above) - that tells us how many non-killed leaf # entries there are. 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 Row 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 30bf5f566..a21aceeb3 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 Fetches: rows=\d+ blocks=\d+', 'Table Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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 Fetches: rows=N blocks=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..ccdb194eb 100644 --- a/src/test/regress/expected/partition_prune.out +++ b/src/test/regress/expected/partition_prune.out @@ -2353,7 +2353,7 @@ 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 +-- bits being set causing "Table Fetches" to be unstable in the EXPLAIN ANALYZE -- output. set enable_indexonlyscan = off; prepare ab_q1 (int, int, int) as diff --git a/src/test/regress/sql/memoize.sql b/src/test/regress/sql/memoize.sql index 594810c37..e7e037760 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 Fetches: rows=\d+ blocks=\d+', 'Table Fetches: rows=N blocks=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..36f404a7f 100644 --- a/src/test/regress/sql/partition_prune.sql +++ b/src/test/regress/sql/partition_prune.sql @@ -566,7 +566,7 @@ 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 +-- bits being set causing "Table Fetches" to be unstable in the EXPLAIN ANALYZE -- output. set enable_indexonlyscan = off; -- 2.55.0