From 42c1160912a56593f0e0ceb1a4b5f91a77e38fc7 Mon Sep 17 00:00:00 2001 From: Lukas Fittl Date: Thu, 19 Mar 2026 11:09:39 -0700 Subject: [PATCH 2/2] Fix regression test failures due to defaulting to IO ON for EXPLAIN --- .../postgres_fdw/expected/postgres_fdw.out | 8 +- contrib/postgres_fdw/sql/postgres_fdw.sql | 8 +- src/test/isolation/expected/merge-update.out | 6 +- src/test/isolation/specs/merge-update.spec | 4 +- .../modules/index/expected/killtuples.out | 44 +- src/test/modules/index/specs/killtuples.spec | 2 +- src/test/regress/expected/explain.out | 585 +++++++++--------- src/test/regress/expected/partition_prune.out | 163 ++--- src/test/regress/sql/partition_prune.sql | 90 +-- 9 files changed, 447 insertions(+), 463 deletions(-) diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out index 0f5271d476e..3f178eda913 100644 --- a/contrib/postgres_fdw/expected/postgres_fdw.out +++ b/contrib/postgres_fdw/expected/postgres_fdw.out @@ -11937,7 +11937,7 @@ SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c Filter: (async_pt_3.a = local_tbl.a) (15 rows) -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c = 'bar'; QUERY PLAN ---------------------------------------------------------------------------------- @@ -12183,7 +12183,7 @@ SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt W Remote SQL: SELECT a, b, c FROM public.base_tbl2 WHERE ((a < 3000)) (20 rows) -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt WHERE a < 3000) FROM async_pt WHERE a < 3000) t2 ON t1.a = t2.a; QUERY PLAN -------------------------------------------------------------------------------------------- @@ -12227,7 +12227,7 @@ SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1; Filter: (t1_3.b === 505) (14 rows) -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1; QUERY PLAN ---------------------------------------------------------------------------- @@ -12387,7 +12387,7 @@ DELETE FROM async_pt WHERE b = 0 RETURNING *; DELETE FROM async_p1; DELETE FROM async_p2; DELETE FROM async_p3; -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM async_pt; QUERY PLAN ---------------------------------------------------------------------------- diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql index 49ed797e8ef..2aee5bb3fe9 100644 --- a/contrib/postgres_fdw/sql/postgres_fdw.sql +++ b/contrib/postgres_fdw/sql/postgres_fdw.sql @@ -4059,7 +4059,7 @@ ALTER FOREIGN TABLE async_p2 OPTIONS (use_remote_estimate 'true'); EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c = 'bar'; -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c = 'bar'; SELECT * FROM local_tbl, async_pt WHERE local_tbl.a = async_pt.a AND local_tbl.c = 'bar'; @@ -4134,13 +4134,13 @@ ANALYZE local_tbl; EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt WHERE a < 3000) FROM async_pt WHERE a < 3000) t2 ON t1.a = t2.a; -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt WHERE a < 3000) FROM async_pt WHERE a < 3000) t2 ON t1.a = t2.a; SELECT * FROM local_tbl t1 LEFT JOIN (SELECT *, (SELECT count(*) FROM async_pt WHERE a < 3000) FROM async_pt WHERE a < 3000) t2 ON t1.a = t2.a; EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1; -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1; SELECT * FROM async_pt t1 WHERE t1.b === 505 LIMIT 1; @@ -4192,7 +4192,7 @@ DELETE FROM async_p1; DELETE FROM async_p2; DELETE FROM async_p3; -EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) +EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF, IO OFF) SELECT * FROM async_pt; -- Clean up diff --git a/src/test/isolation/expected/merge-update.out b/src/test/isolation/expected/merge-update.out index 821565b4303..a7578d8aea6 100644 --- a/src/test/isolation/expected/merge-update.out +++ b/src/test/isolation/expected/merge-update.out @@ -70,7 +70,7 @@ step merge1: step c1: COMMIT; step explain_merge2a: SELECT explain_filter($$ - EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) + EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) MERGE INTO target t USING (SELECT 1 as key, 'merge2a' as val) s ON s.key = t.key @@ -175,7 +175,7 @@ step merge1: step explain_merge2a: SELECT explain_filter($$ - EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) + EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) MERGE INTO target t USING (SELECT 1 as key, 'merge2a' as val) s ON s.key = t.key @@ -358,7 +358,7 @@ step pa_merge1: step explain_pa_merge2a: SELECT explain_filter($$ - EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) + EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) MERGE INTO pa_target t USING (SELECT 1 as key, 'pa_merge2a' as val) s ON s.key = t.key diff --git a/src/test/isolation/specs/merge-update.spec b/src/test/isolation/specs/merge-update.spec index b902779edd6..f69359f69ec 100644 --- a/src/test/isolation/specs/merge-update.spec +++ b/src/test/isolation/specs/merge-update.spec @@ -116,7 +116,7 @@ step "merge2a" step "explain_merge2a" { SELECT explain_filter($$ - EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) + EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) MERGE INTO target t USING (SELECT 1 as key, 'merge2a' as val) s ON s.key = t.key @@ -165,7 +165,7 @@ step "pa_merge2a" step "explain_pa_merge2a" { SELECT explain_filter($$ - EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) + EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) MERGE INTO pa_target t USING (SELECT 1 as key, 'pa_merge2a' as val) s ON s.key = t.key diff --git a/src/test/modules/index/expected/killtuples.out b/src/test/modules/index/expected/killtuples.out index a3db2c40936..550453fece8 100644 --- a/src/test/modules/index/expected/killtuples.out +++ b/src/test/modules/index/expected/killtuples.out @@ -8,7 +8,7 @@ step flush: SELECT FROM pg_stat_force_next_flush(); step disable_seq: SET enable_seqscan = false; step disable_bitmap: SET enable_bitmapscan = false; step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN -------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_btree on kill_prior_tuple (actual rows=1.00 loops=1) @@ -24,7 +24,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN -------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_btree on kill_prior_tuple (actual rows=1.00 loops=1) @@ -42,7 +42,7 @@ t step delete: DELETE FROM kill_prior_tuple; step flush: SELECT FROM pg_stat_force_next_flush(); step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN -------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_btree on kill_prior_tuple (actual rows=0.00 loops=1) @@ -58,7 +58,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN -------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_btree on kill_prior_tuple (actual rows=0.00 loops=1) @@ -84,7 +84,7 @@ step flush: SELECT FROM pg_stat_force_next_flush(); step disable_seq: SET enable_seqscan = false; step disable_bitmap: SET enable_bitmapscan = false; step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=1.00 loops=1) @@ -100,7 +100,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=1.00 loops=1) @@ -118,7 +118,7 @@ t step delete: DELETE FROM kill_prior_tuple; step flush: SELECT FROM pg_stat_force_next_flush(); step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=0.00 loops=1) @@ -134,7 +134,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=0.00 loops=1) @@ -161,7 +161,7 @@ step flush: SELECT FROM pg_stat_force_next_flush(); step disable_seq: SET enable_seqscan = false; step disable_bitmap: SET enable_bitmapscan = false; step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=1.00 loops=1) @@ -177,7 +177,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=1.00 loops=1) @@ -195,7 +195,7 @@ t step delete: DELETE FROM kill_prior_tuple; step flush: SELECT FROM pg_stat_force_next_flush(); step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=0.00 loops=1) @@ -211,7 +211,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_gist on kill_prior_tuple (actual rows=0.00 loops=1) @@ -237,7 +237,7 @@ step flush: SELECT FROM pg_stat_force_next_flush(); step disable_seq: SET enable_seqscan = false; step disable_bitmap: SET enable_bitmapscan = false; step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=1.00 loops=1) @@ -253,7 +253,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=1.00 loops=1) @@ -271,7 +271,7 @@ t step delete: DELETE FROM kill_prior_tuple; step flush: SELECT FROM pg_stat_force_next_flush(); step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=0.00 loops=1) @@ -287,7 +287,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=0.00 loops=1) @@ -312,7 +312,7 @@ step flush: SELECT FROM pg_stat_force_next_flush(); step disable_seq: SET enable_seqscan = false; step disable_bitmap: SET enable_bitmapscan = false; step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN --------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=408.00 loops=1) @@ -328,7 +328,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN --------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=408.00 loops=1) @@ -346,7 +346,7 @@ t step delete: DELETE FROM kill_prior_tuple; step flush: SELECT FROM pg_stat_force_next_flush(); step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=0.00 loops=1) @@ -362,7 +362,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN ------------------------------------------------------------------------------------- Index Scan using kill_prior_tuple_hash on kill_prior_tuple (actual rows=0.00 loops=1) @@ -389,7 +389,7 @@ step disable_seq: SET enable_seqscan = false; step delete: DELETE FROM kill_prior_tuple; step flush: SELECT FROM pg_stat_force_next_flush(); step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN -------------------------------------------------------------------------- Bitmap Heap Scan on kill_prior_tuple (actual rows=0.00 loops=1) @@ -408,7 +408,7 @@ t (1 row) step measure: UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_blks_hit FROM pg_statio_all_tables WHERE relname = 'kill_prior_tuple'); -step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; +step access: EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; QUERY PLAN -------------------------------------------------------------------------- Bitmap Heap Scan on kill_prior_tuple (actual rows=0.00 loops=1) diff --git a/src/test/modules/index/specs/killtuples.spec b/src/test/modules/index/specs/killtuples.spec index 3b98ff9f76d..a5d5c33d788 100644 --- a/src/test/modules/index/specs/killtuples.spec +++ b/src/test/modules/index/specs/killtuples.spec @@ -45,7 +45,7 @@ step measure { UPDATE counter SET heap_accesses = (SELECT heap_blks_read + heap_ step result { SELECT ((heap_blks_read + heap_blks_hit - counter.heap_accesses) > 0) AS has_new_heap_accesses FROM counter, pg_statio_all_tables WHERE relname = 'kill_prior_tuple'; } -step access { EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; } +step access { EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF, IO OFF) SELECT * FROM kill_prior_tuple WHERE key = 1; } step delete { DELETE FROM kill_prior_tuple; } diff --git a/src/test/regress/expected/explain.out b/src/test/regress/expected/explain.out index 2d247f73c14..7894b58da8f 100644 --- a/src/test/regress/expected/explain.out +++ b/src/test/regress/expected/explain.out @@ -295,70 +295,75 @@ select explain_filter('explain verbose select sum(unique1) over w1, sum(unique2) -- but always set in JSON format, so check them only in this case. set track_io_timing = on; select explain_filter('explain (analyze, buffers, format json) select * from int8_tbl i8'); - explain_filter -------------------------------------- - [ + - { + - "Plan": { + - "Node Type": "Seq Scan", + - "Parallel Aware": false, + - "Async Capable": false, + - "Relation Name": "int8_tbl", + - "Alias": "i8", + - "Startup Cost": N.N, + - "Total Cost": N.N, + - "Plan Rows": N, + - "Plan Width": N, + - "Actual Startup Time": N.N, + - "Actual Total Time": N.N, + - "Actual Rows": N.N, + - "Actual Loops": N, + - "Disabled": false, + - "Prefetch": { + - "Average Distance": N.N, + - "Max Distance": N, + - "Capacity": N + - }, + - "Shared Hit Blocks": N, + - "Shared Read Blocks": N, + - "Shared Dirtied Blocks": N, + - "Shared Written Blocks": N, + - "Local Hit Blocks": N, + - "Local Read Blocks": N, + - "Local Dirtied Blocks": N, + - "Local Written Blocks": N, + - "Temp Read Blocks": N, + - "Temp Written Blocks": N, + - "Shared I/O Read Time": N.N, + - "Shared I/O Write Time": N.N,+ - "Local I/O Read Time": N.N, + - "Local I/O Write Time": N.N, + - "Temp I/O Read Time": N.N, + - "Temp I/O Write Time": N.N + - }, + - "Planning": { + - "Shared Hit Blocks": N, + - "Shared Read Blocks": N, + - "Shared Dirtied Blocks": N, + - "Shared Written Blocks": N, + - "Local Hit Blocks": N, + - "Local Read Blocks": N, + - "Local Dirtied Blocks": N, + - "Local Written Blocks": N, + - "Temp Read Blocks": N, + - "Temp Written Blocks": N, + - "Shared I/O Read Time": N.N, + - "Shared I/O Write Time": N.N,+ - "Local I/O Read Time": N.N, + - "Local I/O Write Time": N.N, + - "Temp I/O Read Time": N.N, + - "Temp I/O Write Time": N.N + - }, + - "Planning Time": N.N, + - "Triggers": [ + - ], + - "Execution Time": N.N + - } + + explain_filter +---------------------------------------- + [ + + { + + "Plan": { + + "Node Type": "Seq Scan", + + "Parallel Aware": false, + + "Async Capable": false, + + "Relation Name": "int8_tbl", + + "Alias": "i8", + + "Startup Cost": N.N, + + "Total Cost": N.N, + + "Plan Rows": N, + + "Plan Width": N, + + "Actual Startup Time": N.N, + + "Actual Total Time": N.N, + + "Actual Rows": N.N, + + "Actual Loops": N, + + "Disabled": false, + + "Prefetch": { + + "Average Distance": N.N, + + "Max Distance": N, + + "Capacity": N + + }, + + "I/O": { + + "Stalls": N, + + "Average IO Size": N.N, + + "Average IOs In Progress": N.N+ + }, + + "Shared Hit Blocks": N, + + "Shared Read Blocks": N, + + "Shared Dirtied Blocks": N, + + "Shared Written Blocks": N, + + "Local Hit Blocks": N, + + "Local Read Blocks": N, + + "Local Dirtied Blocks": N, + + "Local Written Blocks": N, + + "Temp Read Blocks": N, + + "Temp Written Blocks": N, + + "Shared I/O Read Time": N.N, + + "Shared I/O Write Time": N.N, + + "Local I/O Read Time": N.N, + + "Local I/O Write Time": N.N, + + "Temp I/O Read Time": N.N, + + "Temp I/O Write Time": N.N + + }, + + "Planning": { + + "Shared Hit Blocks": N, + + "Shared Read Blocks": N, + + "Shared Dirtied Blocks": N, + + "Shared Written Blocks": N, + + "Local Hit Blocks": N, + + "Local Read Blocks": N, + + "Local Dirtied Blocks": N, + + "Local Written Blocks": N, + + "Temp Read Blocks": N, + + "Temp Written Blocks": N, + + "Shared I/O Read Time": N.N, + + "Shared I/O Write Time": N.N, + + "Local I/O Read Time": N.N, + + "Local I/O Write Time": N.N, + + "Temp I/O Read Time": N.N, + + "Temp I/O Write Time": N.N + + }, + + "Planning Time": N.N, + + "Triggers": [ + + ], + + "Execution Time": N.N + + } + ] (1 row) @@ -435,60 +440,65 @@ select explain_filter('explain (memory, summary, format yaml) select * from int8 (1 row) select explain_filter('explain (memory, analyze, format json) select * from int8_tbl i8'); - explain_filter ------------------------------------- - [ + - { + - "Plan": { + - "Node Type": "Seq Scan", + - "Parallel Aware": false, + - "Async Capable": false, + - "Relation Name": "int8_tbl",+ - "Alias": "i8", + - "Startup Cost": N.N, + - "Total Cost": N.N, + - "Plan Rows": N, + - "Plan Width": N, + - "Actual Startup Time": N.N, + - "Actual Total Time": N.N, + - "Actual Rows": N.N, + - "Actual Loops": N, + - "Disabled": false, + - "Prefetch": { + - "Average Distance": N.N, + - "Max Distance": N, + - "Capacity": N + - }, + - "Shared Hit Blocks": N, + - "Shared Read Blocks": N, + - "Shared Dirtied Blocks": N, + - "Shared Written Blocks": N, + - "Local Hit Blocks": N, + - "Local Read Blocks": N, + - "Local Dirtied Blocks": N, + - "Local Written Blocks": N, + - "Temp Read Blocks": N, + - "Temp Written Blocks": N + - }, + - "Planning": { + - "Shared Hit Blocks": N, + - "Shared Read Blocks": N, + - "Shared Dirtied Blocks": N, + - "Shared Written Blocks": N, + - "Local Hit Blocks": N, + - "Local Read Blocks": N, + - "Local Dirtied Blocks": N, + - "Local Written Blocks": N, + - "Temp Read Blocks": N, + - "Temp Written Blocks": N, + - "Memory Used": N, + - "Memory Allocated": N + - }, + - "Planning Time": N.N, + - "Triggers": [ + - ], + - "Execution Time": N.N + - } + + explain_filter +---------------------------------------- + [ + + { + + "Plan": { + + "Node Type": "Seq Scan", + + "Parallel Aware": false, + + "Async Capable": false, + + "Relation Name": "int8_tbl", + + "Alias": "i8", + + "Startup Cost": N.N, + + "Total Cost": N.N, + + "Plan Rows": N, + + "Plan Width": N, + + "Actual Startup Time": N.N, + + "Actual Total Time": N.N, + + "Actual Rows": N.N, + + "Actual Loops": N, + + "Disabled": false, + + "Prefetch": { + + "Average Distance": N.N, + + "Max Distance": N, + + "Capacity": N + + }, + + "I/O": { + + "Stalls": N, + + "Average IO Size": N.N, + + "Average IOs In Progress": N.N+ + }, + + "Shared Hit Blocks": N, + + "Shared Read Blocks": N, + + "Shared Dirtied Blocks": N, + + "Shared Written Blocks": N, + + "Local Hit Blocks": N, + + "Local Read Blocks": N, + + "Local Dirtied Blocks": N, + + "Local Written Blocks": N, + + "Temp Read Blocks": N, + + "Temp Written Blocks": N + + }, + + "Planning": { + + "Shared Hit Blocks": N, + + "Shared Read Blocks": N, + + "Shared Dirtied Blocks": N, + + "Shared Written Blocks": N, + + "Local Hit Blocks": N, + + "Local Read Blocks": N, + + "Local Dirtied Blocks": N, + + "Local Written Blocks": N, + + "Temp Read Blocks": N, + + "Temp Written Blocks": N, + + "Memory Used": N, + + "Memory Allocated": N + + }, + + "Planning Time": N.N, + + "Triggers": [ + + ], + + "Execution Time": N.N + + } + ] (1 row) @@ -552,173 +562,178 @@ select jsonb_pretty( #- '{0,Plan,Plans,0,Sort Method}' #- '{0,Plan,Plans,0,Sort Space Type}' ); - jsonb_pretty -------------------------------------------------------------- - [ + - { + - "Plan": { + - "Plans": [ + - { + - "Plans": [ + - { + - "Alias": "tenk1", + - "Output": [ + - "unique1", + - "unique2", + - "two", + - "four", + - "ten", + - "twenty", + - "hundred", + - "thousand", + - "twothousand", + - "fivethous", + - "tenthous", + - "odd", + - "even", + - "stringu1", + - "stringu2", + - "string4" + - ], + - "Schema": "public", + - "Disabled": false, + - "Prefetch": { + - "Capacity": 0, + - "Max Distance": 0, + - "Average Distance": 0.0 + - }, + - "Node Type": "Seq Scan", + - "Plan Rows": 0, + - "Plan Width": 0, + - "Total Cost": 0.0, + - "Actual Rows": 0.0, + - "Actual Loops": 0, + - "Startup Cost": 0.0, + - "Async Capable": false, + - "Relation Name": "tenk1", + - "Parallel Aware": true, + - "Local Hit Blocks": 0, + - "Temp Read Blocks": 0, + - "Actual Total Time": 0.0, + - "Local Read Blocks": 0, + - "Shared Hit Blocks": 0, + - "Shared Read Blocks": 0, + - "Actual Startup Time": 0.0, + - "Parent Relationship": "Outer",+ - "Temp Written Blocks": 0, + - "Local Dirtied Blocks": 0, + - "Local Written Blocks": 0, + - "Shared Dirtied Blocks": 0, + - "Shared Written Blocks": 0 + - } + - ], + - "Output": [ + - "unique1", + - "unique2", + - "two", + - "four", + - "ten", + - "twenty", + - "hundred", + - "thousand", + - "twothousand", + - "fivethous", + - "tenthous", + - "odd", + - "even", + - "stringu1", + - "stringu2", + - "string4" + - ], + - "Disabled": false, + - "Sort Key": [ + - "tenk1.tenthous" + - ], + - "Node Type": "Sort", + - "Plan Rows": 0, + - "Plan Width": 0, + - "Total Cost": 0.0, + - "Actual Rows": 0.0, + - "Actual Loops": 0, + - "Startup Cost": 0.0, + - "Async Capable": false, + - "Parallel Aware": false, + - "Sort Space Used": 0, + - "Local Hit Blocks": 0, + - "Temp Read Blocks": 0, + - "Actual Total Time": 0.0, + - "Local Read Blocks": 0, + - "Shared Hit Blocks": 0, + - "Shared Read Blocks": 0, + - "Actual Startup Time": 0.0, + - "Parent Relationship": "Outer", + - "Temp Written Blocks": 0, + - "Local Dirtied Blocks": 0, + - "Local Written Blocks": 0, + - "Shared Dirtied Blocks": 0, + - "Shared Written Blocks": 0 + - } + - ], + - "Output": [ + - "unique1", + - "unique2", + - "two", + - "four", + - "ten", + - "twenty", + - "hundred", + - "thousand", + - "twothousand", + - "fivethous", + - "tenthous", + - "odd", + - "even", + - "stringu1", + - "stringu2", + - "string4" + - ], + - "Disabled": false, + - "Node Type": "Gather Merge", + - "Plan Rows": 0, + - "Plan Width": 0, + - "Total Cost": 0.0, + - "Actual Rows": 0.0, + - "Actual Loops": 0, + - "Startup Cost": 0.0, + - "Async Capable": false, + - "Parallel Aware": false, + - "Workers Planned": 0, + - "Local Hit Blocks": 0, + - "Temp Read Blocks": 0, + - "Workers Launched": 0, + - "Actual Total Time": 0.0, + - "Local Read Blocks": 0, + - "Shared Hit Blocks": 0, + - "Shared Read Blocks": 0, + - "Actual Startup Time": 0.0, + - "Temp Written Blocks": 0, + - "Local Dirtied Blocks": 0, + - "Local Written Blocks": 0, + - "Shared Dirtied Blocks": 0, + - "Shared Written Blocks": 0 + - }, + - "Planning": { + - "Local Hit Blocks": 0, + - "Temp Read Blocks": 0, + - "Local Read Blocks": 0, + - "Shared Hit Blocks": 0, + - "Shared Read Blocks": 0, + - "Temp Written Blocks": 0, + - "Local Dirtied Blocks": 0, + - "Local Written Blocks": 0, + - "Shared Dirtied Blocks": 0, + - "Shared Written Blocks": 0 + - }, + - "Triggers": [ + - ], + - "Planning Time": 0.0, + - "Execution Time": 0.0 + - } + + jsonb_pretty +---------------------------------------------------------------- + [ + + { + + "Plan": { + + "Plans": [ + + { + + "Plans": [ + + { + + "I/O": { + + "Stalls": 0, + + "Average IO Size": 0.0, + + "Average IOs In Progress": 0.0+ + }, + + "Alias": "tenk1", + + "Output": [ + + "unique1", + + "unique2", + + "two", + + "four", + + "ten", + + "twenty", + + "hundred", + + "thousand", + + "twothousand", + + "fivethous", + + "tenthous", + + "odd", + + "even", + + "stringu1", + + "stringu2", + + "string4" + + ], + + "Schema": "public", + + "Disabled": false, + + "Prefetch": { + + "Capacity": 0, + + "Max Distance": 0, + + "Average Distance": 0.0 + + }, + + "Node Type": "Seq Scan", + + "Plan Rows": 0, + + "Plan Width": 0, + + "Total Cost": 0.0, + + "Actual Rows": 0.0, + + "Actual Loops": 0, + + "Startup Cost": 0.0, + + "Async Capable": false, + + "Relation Name": "tenk1", + + "Parallel Aware": true, + + "Local Hit Blocks": 0, + + "Temp Read Blocks": 0, + + "Actual Total Time": 0.0, + + "Local Read Blocks": 0, + + "Shared Hit Blocks": 0, + + "Shared Read Blocks": 0, + + "Actual Startup Time": 0.0, + + "Parent Relationship": "Outer", + + "Temp Written Blocks": 0, + + "Local Dirtied Blocks": 0, + + "Local Written Blocks": 0, + + "Shared Dirtied Blocks": 0, + + "Shared Written Blocks": 0 + + } + + ], + + "Output": [ + + "unique1", + + "unique2", + + "two", + + "four", + + "ten", + + "twenty", + + "hundred", + + "thousand", + + "twothousand", + + "fivethous", + + "tenthous", + + "odd", + + "even", + + "stringu1", + + "stringu2", + + "string4" + + ], + + "Disabled": false, + + "Sort Key": [ + + "tenk1.tenthous" + + ], + + "Node Type": "Sort", + + "Plan Rows": 0, + + "Plan Width": 0, + + "Total Cost": 0.0, + + "Actual Rows": 0.0, + + "Actual Loops": 0, + + "Startup Cost": 0.0, + + "Async Capable": false, + + "Parallel Aware": false, + + "Sort Space Used": 0, + + "Local Hit Blocks": 0, + + "Temp Read Blocks": 0, + + "Actual Total Time": 0.0, + + "Local Read Blocks": 0, + + "Shared Hit Blocks": 0, + + "Shared Read Blocks": 0, + + "Actual Startup Time": 0.0, + + "Parent Relationship": "Outer", + + "Temp Written Blocks": 0, + + "Local Dirtied Blocks": 0, + + "Local Written Blocks": 0, + + "Shared Dirtied Blocks": 0, + + "Shared Written Blocks": 0 + + } + + ], + + "Output": [ + + "unique1", + + "unique2", + + "two", + + "four", + + "ten", + + "twenty", + + "hundred", + + "thousand", + + "twothousand", + + "fivethous", + + "tenthous", + + "odd", + + "even", + + "stringu1", + + "stringu2", + + "string4" + + ], + + "Disabled": false, + + "Node Type": "Gather Merge", + + "Plan Rows": 0, + + "Plan Width": 0, + + "Total Cost": 0.0, + + "Actual Rows": 0.0, + + "Actual Loops": 0, + + "Startup Cost": 0.0, + + "Async Capable": false, + + "Parallel Aware": false, + + "Workers Planned": 0, + + "Local Hit Blocks": 0, + + "Temp Read Blocks": 0, + + "Workers Launched": 0, + + "Actual Total Time": 0.0, + + "Local Read Blocks": 0, + + "Shared Hit Blocks": 0, + + "Shared Read Blocks": 0, + + "Actual Startup Time": 0.0, + + "Temp Written Blocks": 0, + + "Local Dirtied Blocks": 0, + + "Local Written Blocks": 0, + + "Shared Dirtied Blocks": 0, + + "Shared Written Blocks": 0 + + }, + + "Planning": { + + "Local Hit Blocks": 0, + + "Temp Read Blocks": 0, + + "Local Read Blocks": 0, + + "Shared Hit Blocks": 0, + + "Shared Read Blocks": 0, + + "Temp Written Blocks": 0, + + "Local Dirtied Blocks": 0, + + "Local Written Blocks": 0, + + "Shared Dirtied Blocks": 0, + + "Shared Written Blocks": 0 + + }, + + "Triggers": [ + + ], + + "Planning Time": 0.0, + + "Execution Time": 0.0 + + } + ] (1 row) diff --git a/src/test/regress/expected/partition_prune.out b/src/test/regress/expected/partition_prune.out index 1332cd0e646..23e8627e5a5 100644 --- a/src/test/regress/expected/partition_prune.out +++ b/src/test/regress/expected/partition_prune.out @@ -2169,7 +2169,7 @@ create table ab_a3_b3 partition of ab_a3 for values in (3); set enable_indexonlyscan = off; prepare ab_q1 (int, int, int) as select * from ab where a between $1 and $2 and b <= $3; -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (2, 2, 3); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (2, 2, 3); QUERY PLAN ------------------------------------------------------------ Append (actual rows=0.00 loops=1) @@ -2182,7 +2182,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 Filter: ((a >= $1) AND (a <= $2) AND (b <= $3)) (8 rows) -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (1, 2, 3); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (1, 2, 3); QUERY PLAN ------------------------------------------------------------ Append (actual rows=0.00 loops=1) @@ -2205,7 +2205,7 @@ deallocate ab_q1; -- Runtime pruning after optimizer pruning prepare ab_q1 (int, int) as select a from ab where a between $1 and $2 and b < 3; -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (2, 2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (2, 2); QUERY PLAN ------------------------------------------------------------ Append (actual rows=0.00 loops=1) @@ -2216,7 +2216,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 Filter: ((a >= $1) AND (a <= $2) AND (b < 3)) (6 rows) -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (2, 4); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (2, 4); QUERY PLAN ------------------------------------------------------------ Append (actual rows=0.00 loops=1) @@ -2235,7 +2235,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 -- different levels of partitioning. prepare ab_q2 (int, int) as select a from ab where a between $1 and $2 and b < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q2 (2, 2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q2 (2, 2); QUERY PLAN ---------------------------------------------------------------------------- Append (actual rows=0.00 loops=1) @@ -2253,7 +2253,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q2 -- As above, but swap the PARAM_EXEC Param to the first partition level prepare ab_q3 (int, int) as select a from ab where b between $1 and $2 and a < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q3 (2, 2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q3 (2, 2); QUERY PLAN ---------------------------------------------------------------------------- Append (actual rows=0.00 loops=1) @@ -2315,57 +2315,48 @@ begin; -- Test run-time pruning using stable functions create function list_part_fn(int) returns int as $$ begin return $1; end;$$ language plpgsql stable; -- Ensure pruning works using a stable function containing no Vars -explain (analyze, costs off, summary off, timing off, buffers off) select * from list_part where a = list_part_fn(1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from list_part where a = list_part_fn(1); QUERY PLAN --------------------------------------------------------------------- Append (actual rows=1.00 loops=1) Subplans Removed: 3 -> Seq Scan on list_part1 list_part_1 (actual rows=1.00 loops=1) Filter: (a = list_part_fn(1)) - Prefetch: avg=1.000 max=1 capacity=94 -(5 rows) +(4 rows) -- Ensure pruning does not take place when the function has a Var parameter -explain (analyze, costs off, summary off, timing off, buffers off) select * from list_part where a = list_part_fn(a); +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from list_part where a = list_part_fn(a); QUERY PLAN --------------------------------------------------------------------- Append (actual rows=4.00 loops=1) -> Seq Scan on list_part1 list_part_1 (actual rows=1.00 loops=1) Filter: (a = list_part_fn(a)) - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on list_part2 list_part_2 (actual rows=1.00 loops=1) Filter: (a = list_part_fn(a)) - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on list_part3 list_part_3 (actual rows=1.00 loops=1) Filter: (a = list_part_fn(a)) - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on list_part4 list_part_4 (actual rows=1.00 loops=1) Filter: (a = list_part_fn(a)) - Prefetch: avg=1.000 max=1 capacity=94 -(13 rows) +(9 rows) -- Ensure pruning does not take place when the expression contains a Var. -explain (analyze, costs off, summary off, timing off, buffers off) select * from list_part where a = list_part_fn(1) + a; +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from list_part where a = list_part_fn(1) + a; QUERY PLAN --------------------------------------------------------------------- Append (actual rows=0.00 loops=1) -> Seq Scan on list_part1 list_part_1 (actual rows=0.00 loops=1) Filter: (a = (list_part_fn(1) + a)) Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on list_part2 list_part_2 (actual rows=0.00 loops=1) Filter: (a = (list_part_fn(1) + a)) Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on list_part3 list_part_3 (actual rows=0.00 loops=1) Filter: (a = (list_part_fn(1) + a)) Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on list_part4 list_part_4 (actual rows=0.00 loops=1) Filter: (a = (list_part_fn(1) + a)) Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -(17 rows) +(13 rows) rollback; drop table list_part; @@ -2385,7 +2376,7 @@ declare ln text; begin for ln in - execute format('explain (analyze, costs off, summary off, timing off, buffers off) %s', + execute format('explain (analyze, costs off, summary off, timing off, buffers off, io off) %s', $1) loop ln := regexp_replace(ln, 'Workers Launched: \d+', 'Workers Launched: N'); @@ -2533,7 +2524,6 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on -> Nested Loop (actual rows=N loops=N) -> Parallel Seq Scan on lprt_a a (actual rows=N loops=N) Filter: (a = ANY ('{0,0,1}'::integer[])) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=N loops=N) -> Index Scan using ab_a1_b1_a_idx on ab_a1_b1 ab_1 (actual rows=N loops=N) Index Cond: (a = a.a) @@ -2553,7 +2543,7 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on Index Cond: (a = a.a) -> Index Scan using ab_a3_b3_a_idx on ab_a3_b3 ab_9 (never executed) Index Cond: (a = a.a) -(28 rows) +(27 rows) -- Ensure the same partitions are pruned when we make the nested loop -- parameter an Expr rather than a plain Param. @@ -2568,7 +2558,6 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on -> Nested Loop (actual rows=N loops=N) -> Parallel Seq Scan on lprt_a a (actual rows=N loops=N) Filter: (a = ANY ('{0,0,1}'::integer[])) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=N loops=N) -> Index Scan using ab_a1_b1_a_idx on ab_a1_b1 ab_1 (actual rows=N loops=N) Index Cond: (a = (a.a + 0)) @@ -2588,7 +2577,7 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on Index Cond: (a = (a.a + 0)) -> Index Scan using ab_a3_b3_a_idx on ab_a3_b3 ab_9 (never executed) Index Cond: (a = (a.a + 0)) -(28 rows) +(27 rows) insert into lprt_a values(3),(3); select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on ab.a = a.a where a.a in(1, 0, 3)'); @@ -2602,7 +2591,6 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on -> Nested Loop (actual rows=N loops=N) -> Parallel Seq Scan on lprt_a a (actual rows=N loops=N) Filter: (a = ANY ('{1,0,3}'::integer[])) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=N loops=N) -> Index Scan using ab_a1_b1_a_idx on ab_a1_b1 ab_1 (actual rows=N loops=N) Index Cond: (a = a.a) @@ -2622,7 +2610,7 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on Index Cond: (a = a.a) -> Index Scan using ab_a3_b3_a_idx on ab_a3_b3 ab_9 (actual rows=N loops=N) Index Cond: (a = a.a) -(28 rows) +(27 rows) select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on ab.a = a.a where a.a in(1, 0, 0)'); explain_parallel_append @@ -2636,7 +2624,6 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on -> Parallel Seq Scan on lprt_a a (actual rows=N loops=N) Filter: (a = ANY ('{1,0,0}'::integer[])) Rows Removed by Filter: N - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=N loops=N) -> Index Scan using ab_a1_b1_a_idx on ab_a1_b1 ab_1 (actual rows=N loops=N) Index Cond: (a = a.a) @@ -2656,7 +2643,7 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on Index Cond: (a = a.a) -> Index Scan using ab_a3_b3_a_idx on ab_a3_b3 ab_9 (never executed) Index Cond: (a = a.a) -(29 rows) +(28 rows) delete from lprt_a where a = 1; select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on ab.a = a.a where a.a in(1, 0, 0)'); @@ -2671,7 +2658,6 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on -> Parallel Seq Scan on lprt_a a (actual rows=N loops=N) Filter: (a = ANY ('{1,0,0}'::integer[])) Rows Removed by Filter: N - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=N loops=N) -> Index Scan using ab_a1_b1_a_idx on ab_a1_b1 ab_1 (never executed) Index Cond: (a = a.a) @@ -2691,7 +2677,7 @@ select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a on Index Cond: (a = a.a) -> Index Scan using ab_a3_b3_a_idx on ab_a3_b3 ab_9 (never executed) Index Cond: (a = a.a) -(29 rows) +(28 rows) reset enable_hashjoin; reset enable_mergejoin; @@ -2701,7 +2687,7 @@ reset parallel_tuple_cost; reset min_parallel_table_scan_size; reset max_parallel_workers_per_gather; -- Test run-time partition pruning with an initplan -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from ab where a = (select max(a) from lprt_a) and b = (select max(a)-1 from lprt_a); QUERY PLAN ---------------------------------------------------------------------------- @@ -2709,11 +2695,9 @@ select * from ab where a = (select max(a) from lprt_a) and b = (select max(a)-1 InitPlan expr_1 -> Aggregate (actual rows=1.00 loops=1) -> Seq Scan on lprt_a (actual rows=102.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 InitPlan expr_2 -> Aggregate (actual rows=1.00 loops=1) -> Seq Scan on lprt_a lprt_a_1 (actual rows=102.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Bitmap Heap Scan on ab_a1_b1 ab_1 (never executed) Recheck Cond: (a = (InitPlan expr_1).col1) Filter: (b = (InitPlan expr_2).col1) @@ -2768,10 +2752,10 @@ select * from ab where a = (select max(a) from lprt_a) and b = (select max(a)-1 -> Bitmap Index Scan on ab_a3_b3_a_idx (never executed) Index Cond: (a = (InitPlan expr_1).col1) Index Searches: 0 -(63 rows) +(61 rows) -- Test run-time partition pruning with UNION ALL parents -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from (select * from ab where a = 1 union all select * from ab) ab where b = (select 1); QUERY PLAN ---------------------------------------------------------------------------------- @@ -2818,7 +2802,7 @@ select * from (select * from ab where a = 1 union all select * from ab) ab where (40 rows) -- A case containing a UNION ALL with a non-partitioned child. -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from (select * from ab where a = 1 union all (values(10,5)) union all select * from ab) ab where b = (select 1); QUERY PLAN ---------------------------------------------------------------------------------- @@ -2880,7 +2864,7 @@ union all select tableoid::regclass,a,b from ab ) ab where a = $1 and b = (select -10); -- Ensure the xy_1 subplan is not pruned. -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q6(1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q6(1); QUERY PLAN ------------------------------------------------------------- Append (actual rows=0.00 loops=1) @@ -2896,14 +2880,13 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q6 -> Seq Scan on xy_1 (actual rows=0.00 loops=1) Filter: ((x = $1) AND (y = (InitPlan expr_1).col1)) Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on ab_a1_b1 ab_4 (never executed) Filter: ((a = $1) AND (b = (InitPlan expr_1).col1)) -> Seq Scan on ab_a1_b2 ab_5 (never executed) Filter: ((a = $1) AND (b = (InitPlan expr_1).col1)) -> Seq Scan on ab_a1_b3 ab_6 (never executed) Filter: ((a = $1) AND (b = (InitPlan expr_1).col1)) -(20 rows) +(19 rows) -- Ensure we see just the xy_1 row. execute ab_q6(100); @@ -3036,13 +3019,12 @@ create index tprt6_idx on tprt_6 (col1); insert into tprt values (10), (20), (501), (502), (505), (1001), (4500); set enable_hashjoin = off; set enable_mergejoin = off; -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 > tprt.col1; QUERY PLAN ----------------------------------------------------------------------------- Nested Loop (actual rows=6.00 loops=1) -> Seq Scan on tbl1 (actual rows=2.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=3.00 loops=2) -> Index Scan using tprt1_idx on tprt_1 (actual rows=2.00 loops=2) Index Cond: (col1 < tbl1.col1) @@ -3062,15 +3044,14 @@ select * from tbl1 join tprt on tbl1.col1 > tprt.col1; -> Index Scan using tprt6_idx on tprt_6 (never executed) Index Cond: (col1 < tbl1.col1) Index Searches: 0 -(22 rows) +(21 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 = tprt.col1; QUERY PLAN ----------------------------------------------------------------------------- Nested Loop (actual rows=2.00 loops=1) -> Seq Scan on tbl1 (actual rows=2.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=1.00 loops=2) -> Index Scan using tprt1_idx on tprt_1 (never executed) Index Cond: (col1 = tbl1.col1) @@ -3090,7 +3071,7 @@ select * from tbl1 join tprt on tbl1.col1 = tprt.col1; -> Index Scan using tprt6_idx on tprt_6 (never executed) Index Cond: (col1 = tbl1.col1) Index Searches: 0 -(22 rows) +(21 rows) select tbl1.col1, tprt.col1 from tbl1 inner join tprt on tbl1.col1 > tprt.col1 @@ -3116,13 +3097,12 @@ order by tbl1.col1, tprt.col1; -- Multiple partitions insert into tbl1 values (1001), (1010), (1011); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 inner join tprt on tbl1.col1 > tprt.col1; QUERY PLAN ----------------------------------------------------------------------------- Nested Loop (actual rows=23.00 loops=1) -> Seq Scan on tbl1 (actual rows=5.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=4.60 loops=5) -> Index Scan using tprt1_idx on tprt_1 (actual rows=2.00 loops=5) Index Cond: (col1 < tbl1.col1) @@ -3142,15 +3122,14 @@ select * from tbl1 inner join tprt on tbl1.col1 > tprt.col1; -> Index Scan using tprt6_idx on tprt_6 (never executed) Index Cond: (col1 < tbl1.col1) Index Searches: 0 -(22 rows) +(21 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 inner join tprt on tbl1.col1 = tprt.col1; QUERY PLAN ----------------------------------------------------------------------------- Nested Loop (actual rows=3.00 loops=1) -> Seq Scan on tbl1 (actual rows=5.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=0.60 loops=5) -> Index Scan using tprt1_idx on tprt_1 (never executed) Index Cond: (col1 = tbl1.col1) @@ -3170,7 +3149,7 @@ select * from tbl1 inner join tprt on tbl1.col1 = tprt.col1; -> Index Scan using tprt6_idx on tprt_6 (never executed) Index Cond: (col1 = tbl1.col1) Index Searches: 0 -(22 rows) +(21 rows) select tbl1.col1, tprt.col1 from tbl1 inner join tprt on tbl1.col1 > tprt.col1 @@ -3215,13 +3194,12 @@ order by tbl1.col1, tprt.col1; -- Last partition delete from tbl1; insert into tbl1 values (4400); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 < tprt.col1; QUERY PLAN ----------------------------------------------------------------------------- Nested Loop (actual rows=1.00 loops=1) -> Seq Scan on tbl1 (actual rows=1.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=1.00 loops=1) -> Index Scan using tprt1_idx on tprt_1 (never executed) Index Cond: (col1 > tbl1.col1) @@ -3241,7 +3219,7 @@ select * from tbl1 join tprt on tbl1.col1 < tprt.col1; -> Index Scan using tprt6_idx on tprt_6 (actual rows=1.00 loops=1) Index Cond: (col1 > tbl1.col1) Index Searches: 1 -(22 rows) +(21 rows) select tbl1.col1, tprt.col1 from tbl1 inner join tprt on tbl1.col1 < tprt.col1 @@ -3254,13 +3232,12 @@ order by tbl1.col1, tprt.col1; -- No matching partition delete from tbl1; insert into tbl1 values (10000); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 = tprt.col1; QUERY PLAN ------------------------------------------------------------------- Nested Loop (actual rows=0.00 loops=1) -> Seq Scan on tbl1 (actual rows=1.00 loops=1) - Prefetch: avg=1.000 max=1 capacity=94 -> Append (actual rows=0.00 loops=1) -> Index Scan using tprt1_idx on tprt_1 (never executed) Index Cond: (col1 = tbl1.col1) @@ -3280,7 +3257,7 @@ select * from tbl1 join tprt on tbl1.col1 = tprt.col1; -> Index Scan using tprt6_idx on tprt_6 (never executed) Index Cond: (col1 = tbl1.col1) Index Searches: 0 -(22 rows) +(21 rows) select tbl1.col1, tprt.col1 from tbl1 inner join tprt on tbl1.col1 = tprt.col1 @@ -3301,7 +3278,7 @@ alter table part_cab attach partition part_abc_p1 for values in(3); prepare part_abc_q1 (int, int, int) as select * from part_abc where a = $1 and b = $2 and c = $3; -- Single partition should be scanned. -explain (analyze, costs off, summary off, timing off, buffers off) execute part_abc_q1 (1, 2, 3); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute part_abc_q1 (1, 2, 3); QUERY PLAN ------------------------------------------------------------- Seq Scan on part_abc_p1 part_abc (actual rows=0.00 loops=1) @@ -3326,7 +3303,7 @@ select * from listp where b = 1; -- partitions before finally detecting the correct set of 2nd level partitions -- which match the given parameter. prepare q1 (int,int) as select * from listp where b in ($1,$2); -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (1,1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (1,1); QUERY PLAN ---------------------------------------------------------------- Append (actual rows=0.00 loops=1) @@ -3335,7 +3312,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute q1 ( Filter: (b = ANY (ARRAY[$1, $2])) (4 rows) -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (2,2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (2,2); QUERY PLAN ---------------------------------------------------------------- Append (actual rows=0.00 loops=1) @@ -3345,7 +3322,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute q1 ( (4 rows) -- Try with no matching partitions. -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (0,0); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (0,0); QUERY PLAN ----------------------------------- Append (actual rows=0.00 loops=1) @@ -3356,7 +3333,7 @@ deallocate q1; -- Test more complex cases where a not-equal condition further eliminates partitions. prepare q1 (int,int,int,int) as select * from listp where b in($1,$2) and $3 <> b and $4 <> b; -- Both partitions allowed by IN clause, but one disallowed by <> clause -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (1,2,2,0); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (1,2,2,0); QUERY PLAN ------------------------------------------------------------------------- Append (actual rows=0.00 loops=1) @@ -3366,7 +3343,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute q1 ( (4 rows) -- Both partitions allowed by IN clause, then both excluded again by <> clauses. -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (1,2,2,1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (1,2,2,1); QUERY PLAN ----------------------------------- Append (actual rows=0.00 loops=1) @@ -3374,7 +3351,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute q1 ( (2 rows) -- Ensure Params that evaluate to NULL properly prune away all partitions -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from listp where a = (select null::int); QUERY PLAN ------------------------------------------------------ @@ -3399,7 +3376,7 @@ create table stable_qual_pruning2 partition of stable_qual_pruning create table stable_qual_pruning3 partition of stable_qual_pruning for values from ('3000-02-01') to ('3000-03-01'); -- comparison against a stable value requires run-time pruning -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a < localtimestamp; QUERY PLAN ----------------------------------------------------------------------------------------- @@ -3412,7 +3389,7 @@ select * from stable_qual_pruning where a < localtimestamp; (6 rows) -- timestamp < timestamptz comparison is only stable, not immutable -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a < '2000-02-01'::timestamptz; QUERY PLAN ----------------------------------------------------------------------------------------- @@ -3423,7 +3400,7 @@ select * from stable_qual_pruning where a < '2000-02-01'::timestamptz; (4 rows) -- check ScalarArrayOp cases -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2010-02-01', '2020-01-01']::timestamp[]); QUERY PLAN @@ -3433,7 +3410,7 @@ select * from stable_qual_pruning One-Time Filter: false (3 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2000-02-01', '2010-01-01']::timestamp[]); QUERY PLAN @@ -3442,7 +3419,7 @@ select * from stable_qual_pruning Filter: (a = ANY ('{"Tue Feb 01 00:00:00 2000","Fri Jan 01 00:00:00 2010"}'::timestamp without time zone[])) (2 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2000-02-01', localtimestamp]::timestamp[]); QUERY PLAN @@ -3453,7 +3430,7 @@ select * from stable_qual_pruning Filter: (a = ANY (ARRAY['Tue Feb 01 00:00:00 2000'::timestamp without time zone, LOCALTIMESTAMP])) (4 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2010-02-01', '2020-01-01']::timestamptz[]); QUERY PLAN @@ -3462,7 +3439,7 @@ select * from stable_qual_pruning Subplans Removed: 3 (2 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2000-02-01', '2010-01-01']::timestamptz[]); QUERY PLAN @@ -3473,7 +3450,7 @@ select * from stable_qual_pruning Filter: (a = ANY ('{"Tue Feb 01 00:00:00 2000 PST","Fri Jan 01 00:00:00 2010 PST"}'::timestamp with time zone[])) (4 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(null::timestamptz[]); QUERY PLAN @@ -3501,21 +3478,18 @@ create table mc3p1 partition of mc3p create table mc3p2 partition of mc3p for values from (2, minvalue, minvalue) to (3, maxvalue, maxvalue); insert into mc3p values (0, 1, 1), (1, 1, 1), (2, 1, 1); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from mc3p where a < 3 and abs(b) = 1; QUERY PLAN ----------------------------------------------------------- Append (actual rows=3.00 loops=1) -> Seq Scan on mc3p0 mc3p_1 (actual rows=1.00 loops=1) Filter: ((a < 3) AND (abs(b) = 1)) - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on mc3p1 mc3p_2 (actual rows=1.00 loops=1) Filter: ((a < 3) AND (abs(b) = 1)) - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on mc3p2 mc3p_3 (actual rows=1.00 loops=1) Filter: ((a < 3) AND (abs(b) = 1)) - Prefetch: avg=1.000 max=1 capacity=94 -(10 rows) +(7 rows) -- -- Check that pruning with composite range partitioning works correctly when @@ -3524,7 +3498,7 @@ select * from mc3p where a < 3 and abs(b) = 1; -- prepare ps1 as select * from mc3p where a = $1 and abs(b) < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ps1(1); QUERY PLAN ------------------------------------------------------------------ @@ -3534,13 +3508,12 @@ execute ps1(1); -> Result (actual rows=1.00 loops=1) -> Seq Scan on mc3p1 mc3p_1 (actual rows=1.00 loops=1) Filter: ((a = $1) AND (abs(b) < (InitPlan expr_1).col1)) - Prefetch: avg=1.000 max=1 capacity=94 -(7 rows) +(6 rows) deallocate ps1; prepare ps2 as select * from mc3p where a <= $1 and abs(b) < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ps2(1); QUERY PLAN ------------------------------------------------------------------- @@ -3550,11 +3523,9 @@ execute ps2(1); -> Result (actual rows=1.00 loops=1) -> Seq Scan on mc3p0 mc3p_1 (actual rows=1.00 loops=1) Filter: ((a <= $1) AND (abs(b) < (InitPlan expr_1).col1)) - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on mc3p1 mc3p_2 (actual rows=1.00 loops=1) Filter: ((a <= $1) AND (abs(b) < (InitPlan expr_1).col1)) - Prefetch: avg=1.000 max=1 capacity=94 -(10 rows) +(8 rows) deallocate ps2; drop table mc3p; @@ -3564,7 +3535,7 @@ insert into boolvalues values('t'),('f'); create table boolp (a bool) partition by list (a); create table boolp_t partition of boolp for values in('t'); create table boolp_f partition of boolp for values in('f'); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from boolp where a = (select value from boolvalues where value); QUERY PLAN -------------------------------------------------------------- @@ -3573,14 +3544,13 @@ select * from boolp where a = (select value from boolvalues where value); -> Seq Scan on boolvalues (actual rows=1.00 loops=1) Filter: value Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on boolp_f boolp_1 (never executed) Filter: (a = (InitPlan expr_1).col1) -> Seq Scan on boolp_t boolp_2 (actual rows=0.00 loops=1) Filter: (a = (InitPlan expr_1).col1) -(10 rows) +(9 rows) -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from boolp where a = (select value from boolvalues where not value); QUERY PLAN -------------------------------------------------------------- @@ -3589,12 +3559,11 @@ select * from boolp where a = (select value from boolvalues where not value); -> Seq Scan on boolvalues (actual rows=1.00 loops=1) Filter: (NOT value) Rows Removed by Filter: 1 - Prefetch: avg=1.000 max=1 capacity=94 -> Seq Scan on boolp_f boolp_1 (actual rows=0.00 loops=1) Filter: (a = (InitPlan expr_1).col1) -> Seq Scan on boolp_t boolp_2 (never executed) Filter: (a = (InitPlan expr_1).col1) -(10 rows) +(9 rows) drop table boolp; -- @@ -3610,7 +3579,7 @@ insert into ma_test select x,x from generate_series(0,29) t(x); create index on ma_test (b); analyze ma_test; prepare mt_q1 (int) as select a from ma_test where a >= $1 and a % 10 = 5 order by b; -explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1(15); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute mt_q1(15); QUERY PLAN -------------------------------------------------------------------------------------------- Merge Append (actual rows=2.00 loops=1) @@ -3633,7 +3602,7 @@ execute mt_q1(15); 25 (2 rows) -explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1(25); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute mt_q1(25); QUERY PLAN -------------------------------------------------------------------------------------------- Merge Append (actual rows=1.00 loops=1) @@ -3652,7 +3621,7 @@ execute mt_q1(25); (1 row) -- Ensure MergeAppend behaves correctly when no subplans match -explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1(35); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute mt_q1(35); QUERY PLAN ----------------------------------------- Merge Append (actual rows=0.00 loops=1) @@ -3680,7 +3649,7 @@ explain (analyze, verbose, costs off, summary off, timing off, buffers off) exec deallocate mt_q2; -- ensure initplan params properly prune partitions -explain (analyze, costs off, summary off, timing off, buffers off) select * from ma_test where a >= (select min(b) from ma_test_p2) order by b; +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from ma_test where a >= (select min(b) from ma_test_p2) order by b; QUERY PLAN -------------------------------------------------------------------------------------------------- Merge Append (actual rows=20.00 loops=1) @@ -4139,7 +4108,7 @@ create table listp (a int, b int) partition by list (a); create table listp1 partition of listp for values in(1); create table listp2 partition of listp for values in(2) partition by list(b); create table listp2_10 partition of listp2 for values in (10); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from listp where a = (select 2) and b <> 10; QUERY PLAN -------------------------------------------------------- diff --git a/src/test/regress/sql/partition_prune.sql b/src/test/regress/sql/partition_prune.sql index 212de0e6285..0934cca73f6 100644 --- a/src/test/regress/sql/partition_prune.sql +++ b/src/test/regress/sql/partition_prune.sql @@ -480,8 +480,8 @@ set enable_indexonlyscan = off; prepare ab_q1 (int, int, int) as select * from ab where a between $1 and $2 and b <= $3; -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (2, 2, 3); -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (1, 2, 3); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (2, 2, 3); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (1, 2, 3); deallocate ab_q1; @@ -489,21 +489,21 @@ deallocate ab_q1; prepare ab_q1 (int, int) as select a from ab where a between $1 and $2 and b < 3; -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (2, 2); -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q1 (2, 4); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (2, 2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q1 (2, 4); -- Ensure a mix of PARAM_EXTERN and PARAM_EXEC Params work together at -- different levels of partitioning. prepare ab_q2 (int, int) as select a from ab where a between $1 and $2 and b < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q2 (2, 2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q2 (2, 2); -- As above, but swap the PARAM_EXEC Param to the first partition level prepare ab_q3 (int, int) as select a from ab where b between $1 and $2 and a < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q3 (2, 2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q3 (2, 2); -- -- Test runtime pruning with hash partitioned tables @@ -553,13 +553,13 @@ begin; create function list_part_fn(int) returns int as $$ begin return $1; end;$$ language plpgsql stable; -- Ensure pruning works using a stable function containing no Vars -explain (analyze, costs off, summary off, timing off, buffers off) select * from list_part where a = list_part_fn(1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from list_part where a = list_part_fn(1); -- Ensure pruning does not take place when the function has a Var parameter -explain (analyze, costs off, summary off, timing off, buffers off) select * from list_part where a = list_part_fn(a); +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from list_part where a = list_part_fn(a); -- Ensure pruning does not take place when the expression contains a Var. -explain (analyze, costs off, summary off, timing off, buffers off) select * from list_part where a = list_part_fn(1) + a; +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from list_part where a = list_part_fn(1) + a; rollback; @@ -582,7 +582,7 @@ declare ln text; begin for ln in - execute format('explain (analyze, costs off, summary off, timing off, buffers off) %s', + execute format('explain (analyze, costs off, summary off, timing off, buffers off, io off) %s', $1) loop ln := regexp_replace(ln, 'Workers Launched: \d+', 'Workers Launched: N'); @@ -669,15 +669,15 @@ reset min_parallel_table_scan_size; reset max_parallel_workers_per_gather; -- Test run-time partition pruning with an initplan -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from ab where a = (select max(a) from lprt_a) and b = (select max(a)-1 from lprt_a); -- Test run-time partition pruning with UNION ALL parents -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from (select * from ab where a = 1 union all select * from ab) ab where b = (select 1); -- A case containing a UNION ALL with a non-partitioned child. -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from (select * from ab where a = 1 union all (values(10,5)) union all select * from ab) ab where b = (select 1); -- Another UNION ALL test, but containing a mix of exec init and exec run-time pruning. @@ -697,7 +697,7 @@ union all ) ab where a = $1 and b = (select -10); -- Ensure the xy_1 subplan is not pruned. -explain (analyze, costs off, summary off, timing off, buffers off) execute ab_q6(1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ab_q6(1); -- Ensure we see just the xy_1 row. execute ab_q6(100); @@ -752,10 +752,10 @@ insert into tprt values (10), (20), (501), (502), (505), (1001), (4500); set enable_hashjoin = off; set enable_mergejoin = off; -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 > tprt.col1; -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 = tprt.col1; select tbl1.col1, tprt.col1 from tbl1 @@ -768,10 +768,10 @@ order by tbl1.col1, tprt.col1; -- Multiple partitions insert into tbl1 values (1001), (1010), (1011); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 inner join tprt on tbl1.col1 > tprt.col1; -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 inner join tprt on tbl1.col1 = tprt.col1; select tbl1.col1, tprt.col1 from tbl1 @@ -785,7 +785,7 @@ order by tbl1.col1, tprt.col1; -- Last partition delete from tbl1; insert into tbl1 values (4400); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 < tprt.col1; select tbl1.col1, tprt.col1 from tbl1 @@ -795,7 +795,7 @@ order by tbl1.col1, tprt.col1; -- No matching partition delete from tbl1; insert into tbl1 values (10000); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from tbl1 join tprt on tbl1.col1 = tprt.col1; select tbl1.col1, tprt.col1 from tbl1 @@ -818,7 +818,7 @@ prepare part_abc_q1 (int, int, int) as select * from part_abc where a = $1 and b = $2 and c = $3; -- Single partition should be scanned. -explain (analyze, costs off, summary off, timing off, buffers off) execute part_abc_q1 (1, 2, 3); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute part_abc_q1 (1, 2, 3); deallocate part_abc_q1; @@ -838,12 +838,12 @@ select * from listp where b = 1; -- which match the given parameter. prepare q1 (int,int) as select * from listp where b in ($1,$2); -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (1,1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (1,1); -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (2,2); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (2,2); -- Try with no matching partitions. -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (0,0); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (0,0); deallocate q1; @@ -851,13 +851,13 @@ deallocate q1; prepare q1 (int,int,int,int) as select * from listp where b in($1,$2) and $3 <> b and $4 <> b; -- Both partitions allowed by IN clause, but one disallowed by <> clause -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (1,2,2,0); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (1,2,2,0); -- Both partitions allowed by IN clause, then both excluded again by <> clauses. -explain (analyze, costs off, summary off, timing off, buffers off) execute q1 (1,2,2,1); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute q1 (1,2,2,1); -- Ensure Params that evaluate to NULL properly prune away all partitions -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from listp where a = (select null::int); drop table listp; @@ -874,30 +874,30 @@ create table stable_qual_pruning3 partition of stable_qual_pruning for values from ('3000-02-01') to ('3000-03-01'); -- comparison against a stable value requires run-time pruning -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a < localtimestamp; -- timestamp < timestamptz comparison is only stable, not immutable -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a < '2000-02-01'::timestamptz; -- check ScalarArrayOp cases -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2010-02-01', '2020-01-01']::timestamp[]); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2000-02-01', '2010-01-01']::timestamp[]); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2000-02-01', localtimestamp]::timestamp[]); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2010-02-01', '2020-01-01']::timestamptz[]); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(array['2000-02-01', '2010-01-01']::timestamptz[]); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from stable_qual_pruning where a = any(null::timestamptz[]); @@ -917,7 +917,7 @@ create table mc3p2 partition of mc3p for values from (2, minvalue, minvalue) to (3, maxvalue, maxvalue); insert into mc3p values (0, 1, 1), (1, 1, 1), (2, 1, 1); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from mc3p where a < 3 and abs(b) = 1; -- @@ -927,12 +927,12 @@ select * from mc3p where a < 3 and abs(b) = 1; -- prepare ps1 as select * from mc3p where a = $1 and abs(b) < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ps1(1); deallocate ps1; prepare ps2 as select * from mc3p where a <= $1 and abs(b) < (select 3); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute ps2(1); deallocate ps2; @@ -946,10 +946,10 @@ create table boolp (a bool) partition by list (a); create table boolp_t partition of boolp for values in('t'); create table boolp_f partition of boolp for values in('f'); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from boolp where a = (select value from boolvalues where value); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from boolp where a = (select value from boolvalues where not value); drop table boolp; @@ -969,12 +969,12 @@ create index on ma_test (b); analyze ma_test; prepare mt_q1 (int) as select a from ma_test where a >= $1 and a % 10 = 5 order by b; -explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1(15); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute mt_q1(15); execute mt_q1(15); -explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1(25); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute mt_q1(25); execute mt_q1(25); -- Ensure MergeAppend behaves correctly when no subplans match -explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1(35); +explain (analyze, costs off, summary off, timing off, buffers off, io off) execute mt_q1(35); execute mt_q1(35); deallocate mt_q1; @@ -987,7 +987,7 @@ explain (analyze, verbose, costs off, summary off, timing off, buffers off) exec deallocate mt_q2; -- ensure initplan params properly prune partitions -explain (analyze, costs off, summary off, timing off, buffers off) select * from ma_test where a >= (select min(b) from ma_test_p2) order by b; +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from ma_test where a >= (select min(b) from ma_test_p2) order by b; reset enable_seqscan; reset enable_sort; @@ -1167,7 +1167,7 @@ create table listp1 partition of listp for values in(1); create table listp2 partition of listp for values in(2) partition by list(b); create table listp2_10 partition of listp2 for values in (10); -explain (analyze, costs off, summary off, timing off, buffers off) +explain (analyze, costs off, summary off, timing off, buffers off, io off) select * from listp where a = (select 2) and b <> 10; -- -- 2.47.1