Fix EXPLAIN output in regression tests for consistency (#8332)

pull/8334/head^2
Mehmet YILMAZ 2025-11-13 11:16:33 +03:00 committed by GitHub
parent f80fa1c83b
commit 8bba66f207
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 53 additions and 43 deletions

View File

@ -979,6 +979,7 @@ DETAIL: unparameterized; 1 clauses pushed down
(1 row) (1 row)
SET hash_mem_multiplier = 1.0; SET hash_mem_multiplier = 1.0;
\pset footer off
SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$ SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF) EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF)
SELECT sum(a) FROM pushdown_test where SELECT sum(a) FROM pushdown_test where
@ -1017,8 +1018,8 @@ CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_form
-> Materialize (actual rows=100 loops=199) -> Materialize (actual rows=100 loops=199)
-> Custom Scan (ColumnarScan) on pushdown_test pushdown_test_1 (actual rows=199 loops=1) -> Custom Scan (ColumnarScan) on pushdown_test pushdown_test_1 (actual rows=199 loops=1)
Columnar Projected Columns: a Columnar Projected Columns: a
(11 rows)
\pset footer on
RESET hash_mem_multiplier; RESET hash_mem_multiplier;
SELECT sum(a) FROM pushdown_test where SELECT sum(a) FROM pushdown_test where
( (

View File

@ -979,6 +979,7 @@ DETAIL: unparameterized; 1 clauses pushed down
(1 row) (1 row)
SET hash_mem_multiplier = 1.0; SET hash_mem_multiplier = 1.0;
\pset footer off
SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$ SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF) EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF)
SELECT sum(a) FROM pushdown_test where SELECT sum(a) FROM pushdown_test where
@ -1017,8 +1018,8 @@ CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_form
-> Materialize (actual rows=100 loops=199) -> Materialize (actual rows=100 loops=199)
-> Custom Scan (ColumnarScan) on pushdown_test pushdown_test_1 (actual rows=199 loops=1) -> Custom Scan (ColumnarScan) on pushdown_test pushdown_test_1 (actual rows=199 loops=1)
Columnar Projected Columns: a Columnar Projected Columns: a
(11 rows)
\pset footer on
RESET hash_mem_multiplier; RESET hash_mem_multiplier;
SELECT sum(a) FROM pushdown_test where SELECT sum(a) FROM pushdown_test where
( (

View File

@ -604,11 +604,11 @@ SELECT * FROM correlated WHERE x = 78910;
(1 row) (1 row)
-- should choose index scan; selective but uncorrelated -- should choose index scan; selective but uncorrelated
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF) EXPLAIN (analyze off, costs off, timing off, summary off, BUFFERS OFF)
SELECT * FROM uncorrelated WHERE x = 78910; SELECT * FROM uncorrelated WHERE x = 78910;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------- ---------------------------------------------------------------------
Index Scan using uncorrelated_idx on uncorrelated (actual rows=1 loops=1) Index Scan using uncorrelated_idx on uncorrelated
Index Cond: (x = 78910) Index Cond: (x = 78910)
(2 rows) (2 rows)

View File

@ -608,11 +608,11 @@ SELECT * FROM correlated WHERE x = 78910;
(1 row) (1 row)
-- should choose index scan; selective but uncorrelated -- should choose index scan; selective but uncorrelated
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF) EXPLAIN (analyze off, costs off, timing off, summary off, BUFFERS OFF)
SELECT * FROM uncorrelated WHERE x = 78910; SELECT * FROM uncorrelated WHERE x = 78910;
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------- ---------------------------------------------------------------------
Index Scan using uncorrelated_idx on uncorrelated (actual rows=1 loops=1) Index Scan using uncorrelated_idx on uncorrelated
Index Cond: (x = 78910) Index Cond: (x = 78910)
(2 rows) (2 rows)

View File

@ -519,20 +519,22 @@ Custom Scan (Citus Adaptive)
Filter: (l_partkey = 0) Filter: (l_partkey = 0)
-- Test analyze (with TIMING FALSE and SUMMARY FALSE for consistent output) -- Test analyze (with TIMING FALSE and SUMMARY FALSE for consistent output)
BEGIN; BEGIN;
select public.explain_filter('
EXPLAIN (COSTS FALSE, ANALYZE TRUE, TIMING FALSE, SUMMARY FALSE, BUFFERS OFF) EXPLAIN (COSTS FALSE, ANALYZE TRUE, TIMING FALSE, SUMMARY FALSE, BUFFERS OFF)
UPDATE lineitem UPDATE lineitem
SET l_suppkey = 12 SET l_suppkey = 12
WHERE l_orderkey = 1 AND l_partkey = 0; WHERE l_orderkey = 1 AND l_partkey = 0
Custom Scan (Citus Adaptive) (actual rows=0 loops=1) ');
Task Count: 1 Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: N
Tasks Shown: All Tasks Shown: All
-> Task -> Task
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=N dbname=regression
-> Update on lineitem_360000 lineitem (actual rows=0 loops=1) -> Update on lineitem_360000 lineitem (actual rows=N loops=N)
-> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=0 loops=1) -> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=N loops=N)
Index Cond: (l_orderkey = 1) Index Cond: (l_orderkey = N)
Filter: (l_partkey = 0) Filter: (l_partkey = N)
Rows Removed by Filter: 6 Rows Removed by Filter: N
ROLLBACk; ROLLBACk;
-- Test delete -- Test delete
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)
@ -1387,16 +1389,16 @@ Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0)
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=xxxxx dbname=regression
-> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (cost=0.28..13.60 rows=4 width=5) -> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (cost=0.28..13.60 rows=4 width=5)
Index Cond: (l_orderkey = 5) Index Cond: (l_orderkey = 5)
EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) EXECUTE router_executor_query_param(5); select public.explain_filter('EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) EXECUTE router_executor_query_param(5)');
Custom Scan (Citus Adaptive) (actual rows=3 loops=1) Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: 1 Task Count: N
Tuple data received from nodes: 30 bytes Tuple data received from nodes: N bytes
Tasks Shown: All Tasks Shown: All
-> Task -> Task
Tuple data received from node: 30 bytes Tuple data received from node: N bytes
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=N dbname=regression
-> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=3 loops=1) -> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=N loops=N)
Index Cond: (l_orderkey = 5) Index Cond: (l_orderkey = N)
\set VERBOSITY TERSE \set VERBOSITY TERSE
PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1; PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1;
BEGIN; BEGIN;

View File

@ -519,20 +519,22 @@ Custom Scan (Citus Adaptive)
Filter: (l_partkey = 0) Filter: (l_partkey = 0)
-- Test analyze (with TIMING FALSE and SUMMARY FALSE for consistent output) -- Test analyze (with TIMING FALSE and SUMMARY FALSE for consistent output)
BEGIN; BEGIN;
select public.explain_filter('
EXPLAIN (COSTS FALSE, ANALYZE TRUE, TIMING FALSE, SUMMARY FALSE, BUFFERS OFF) EXPLAIN (COSTS FALSE, ANALYZE TRUE, TIMING FALSE, SUMMARY FALSE, BUFFERS OFF)
UPDATE lineitem UPDATE lineitem
SET l_suppkey = 12 SET l_suppkey = 12
WHERE l_orderkey = 1 AND l_partkey = 0; WHERE l_orderkey = 1 AND l_partkey = 0
Custom Scan (Citus Adaptive) (actual rows=0 loops=1) ');
Task Count: 1 Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: N
Tasks Shown: All Tasks Shown: All
-> Task -> Task
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=N dbname=regression
-> Update on lineitem_360000 lineitem (actual rows=0 loops=1) -> Update on lineitem_360000 lineitem (actual rows=N loops=N)
-> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=0 loops=1) -> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=N loops=N)
Index Cond: (l_orderkey = 1) Index Cond: (l_orderkey = N)
Filter: (l_partkey = 0) Filter: (l_partkey = N)
Rows Removed by Filter: 6 Rows Removed by Filter: N
ROLLBACk; ROLLBACk;
-- Test delete -- Test delete
EXPLAIN (COSTS FALSE) EXPLAIN (COSTS FALSE)
@ -1387,16 +1389,16 @@ Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0)
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=xxxxx dbname=regression
-> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (cost=0.28..13.60 rows=4 width=5) -> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (cost=0.28..13.60 rows=4 width=5)
Index Cond: (l_orderkey = 5) Index Cond: (l_orderkey = 5)
EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) EXECUTE router_executor_query_param(5); select public.explain_filter('EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) EXECUTE router_executor_query_param(5)');
Custom Scan (Citus Adaptive) (actual rows=3 loops=1) Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: 1 Task Count: N
Tuple data received from nodes: 30 bytes Tuple data received from nodes: N bytes
Tasks Shown: All Tasks Shown: All
-> Task -> Task
Tuple data received from node: 30 bytes Tuple data received from node: N bytes
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=N dbname=regression
-> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=3 loops=1) -> Index Scan using lineitem_pkey_360000 on lineitem_360000 lineitem (actual rows=N loops=N)
Index Cond: (l_orderkey = 5) Index Cond: (l_orderkey = N)
\set VERBOSITY TERSE \set VERBOSITY TERSE
PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1; PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1;
BEGIN; BEGIN;

View File

@ -419,6 +419,7 @@ SELECT sum(a) FROM pushdown_test where (a > random() and a <= 2000) or (a > 2000
SELECT sum(a) FROM pushdown_test where (a > random() and a <= 2000) or (a > 200000-1010); SELECT sum(a) FROM pushdown_test where (a > random() and a <= 2000) or (a > 200000-1010);
SET hash_mem_multiplier = 1.0; SET hash_mem_multiplier = 1.0;
\pset footer off
SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$ SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF) EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF)
SELECT sum(a) FROM pushdown_test where SELECT sum(a) FROM pushdown_test where
@ -433,6 +434,7 @@ SELECT sum(a) FROM pushdown_test where
or or
(a > 200000-2010); (a > 200000-2010);
$Q$) as "QUERY PLAN"; $Q$) as "QUERY PLAN";
\pset footer on
RESET hash_mem_multiplier; RESET hash_mem_multiplier;
SELECT sum(a) FROM pushdown_test where SELECT sum(a) FROM pushdown_test where
( (

View File

@ -373,7 +373,7 @@ SELECT * FROM correlated WHERE x = 78910;
SELECT * FROM correlated WHERE x = 78910; SELECT * FROM correlated WHERE x = 78910;
-- should choose index scan; selective but uncorrelated -- should choose index scan; selective but uncorrelated
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF) EXPLAIN (analyze off, costs off, timing off, summary off, BUFFERS OFF)
SELECT * FROM uncorrelated WHERE x = 78910; SELECT * FROM uncorrelated WHERE x = 78910;
SELECT * FROM uncorrelated WHERE x = 78910; SELECT * FROM uncorrelated WHERE x = 78910;

View File

@ -184,10 +184,12 @@ EXPLAIN (COSTS FALSE)
-- Test analyze (with TIMING FALSE and SUMMARY FALSE for consistent output) -- Test analyze (with TIMING FALSE and SUMMARY FALSE for consistent output)
BEGIN; BEGIN;
select public.explain_filter('
EXPLAIN (COSTS FALSE, ANALYZE TRUE, TIMING FALSE, SUMMARY FALSE, BUFFERS OFF) EXPLAIN (COSTS FALSE, ANALYZE TRUE, TIMING FALSE, SUMMARY FALSE, BUFFERS OFF)
UPDATE lineitem UPDATE lineitem
SET l_suppkey = 12 SET l_suppkey = 12
WHERE l_orderkey = 1 AND l_partkey = 0; WHERE l_orderkey = 1 AND l_partkey = 0
');
ROLLBACk; ROLLBACk;
-- Test delete -- Test delete
@ -597,7 +599,7 @@ EXPLAIN (COSTS FALSE) EXECUTE real_time_executor_query;
-- at least make sure to fail without crashing -- at least make sure to fail without crashing
PREPARE router_executor_query_param(int) AS SELECT l_quantity FROM lineitem WHERE l_orderkey = $1; PREPARE router_executor_query_param(int) AS SELECT l_quantity FROM lineitem WHERE l_orderkey = $1;
EXPLAIN EXECUTE router_executor_query_param(5); EXPLAIN EXECUTE router_executor_query_param(5);
EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) EXECUTE router_executor_query_param(5); select public.explain_filter('EXPLAIN (ANALYZE ON, COSTS OFF, TIMING OFF, SUMMARY OFF, BUFFERS OFF) EXECUTE router_executor_query_param(5)');
\set VERBOSITY TERSE \set VERBOSITY TERSE
PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1; PREPARE multi_shard_query_param(int) AS UPDATE lineitem SET l_quantity = $1;