Merge branch 'main' into eag/mvtest1

pull/8334/head
eaydingol 2025-11-14 09:31:06 +03:00 committed by GitHub
commit 6d65a1f8f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 163 additions and 108 deletions

View File

@ -376,9 +376,12 @@ s/\<is referenced from table\>/is still referenced from table/g
# ignore any "find_in_path:" lines in test output # ignore any "find_in_path:" lines in test output
/DEBUG: find_in_path: trying .*/d /DEBUG: find_in_path: trying .*/d
# PG18: EXPLAIN ANALYZE prints "Index Searches: N" for index scans — remove it
/^\s*Index Searches:\s*\d+\s*$/d
# EXPLAIN (PG18+): hide Materialize storage instrumentation # EXPLAIN (PG18+): hide Materialize storage instrumentation
# this rule can be removed when PG18 is the minimum supported version # this rule can be removed when PG18 is the minimum supported version
/^[ \t]*Storage:[ \t].*$/d /^[ \t]*Storage:[ \t].*$/d
# PG18: drop 'subscription "<name>"' prefix
# this rule can be removed when PG18 is the minimum supported version
s/^[[:space:]]*ERROR:[[:space:]]+subscription "[^"]+" could not connect to the publisher:[[:space:]]*/ERROR: could not connect to the publisher: /I
# PG18: drop verbose 'connection to server … failed:' preamble
s/^[[:space:]]*ERROR:[[:space:]]+could not connect to the publisher:[[:space:]]*connection to server .* failed:[[:space:]]*/ERROR: could not connect to the publisher: /I

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

@ -204,18 +204,24 @@ $$
t t
(1 row) (1 row)
SELECT columnar_test_helpers.uses_custom_scan ( BEGIN;
$$ SET LOCAL enable_indexscan TO 'OFF';
SELECT a FROM full_correlated WHERE a=0 OR a=5; SET LOCAL enable_bitmapscan TO 'OFF';
$$ SELECT columnar_test_helpers.uses_custom_scan (
); $$
SELECT a FROM full_correlated WHERE a=0 OR a=5;
$$
);
uses_custom_scan uses_custom_scan
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
ROLLBACK;
BEGIN; BEGIN;
SET LOCAL columnar.enable_custom_scan TO 'OFF'; SET LOCAL columnar.enable_custom_scan TO 'OFF';
SET LOCAL enable_indexscan TO 'OFF';
SET LOCAL enable_bitmapscan TO 'OFF';
SELECT columnar_test_helpers.uses_seq_scan ( SELECT columnar_test_helpers.uses_seq_scan (
$$ $$
SELECT a FROM full_correlated WHERE a=0 OR a=5; SELECT a FROM full_correlated WHERE a=0 OR a=5;
@ -598,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

@ -204,18 +204,24 @@ $$
t t
(1 row) (1 row)
SELECT columnar_test_helpers.uses_custom_scan ( BEGIN;
$$ SET LOCAL enable_indexscan TO 'OFF';
SELECT a FROM full_correlated WHERE a=0 OR a=5; SET LOCAL enable_bitmapscan TO 'OFF';
$$ SELECT columnar_test_helpers.uses_custom_scan (
); $$
SELECT a FROM full_correlated WHERE a=0 OR a=5;
$$
);
uses_custom_scan uses_custom_scan
--------------------------------------------------------------------- ---------------------------------------------------------------------
t t
(1 row) (1 row)
ROLLBACK;
BEGIN; BEGIN;
SET LOCAL columnar.enable_custom_scan TO 'OFF'; SET LOCAL columnar.enable_custom_scan TO 'OFF';
SET LOCAL enable_indexscan TO 'OFF';
SET LOCAL enable_bitmapscan TO 'OFF';
SELECT columnar_test_helpers.uses_seq_scan ( SELECT columnar_test_helpers.uses_seq_scan (
$$ $$
SELECT a FROM full_correlated WHERE a=0 OR a=5; SELECT a FROM full_correlated WHERE a=0 OR a=5;
@ -602,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

@ -312,21 +312,22 @@ EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
Filter: (age = 20) Filter: (age = 20)
(8 rows) (8 rows)
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
QUERY PLAN select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20');
explain_filter
--------------------------------------------------------------------- ---------------------------------------------------------------------
Custom Scan (Citus Adaptive) (actual rows=1 loops=1) Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: 1 Task Count: N
Tuple data received from nodes: 14 bytes Tuple data received from nodes: N bytes
Tasks Shown: All Tasks Shown: All
-> Task -> Task
Tuple data received from node: 14 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 distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=1 loops=1) -> Index Scan using distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=N loops=N)
Index Cond: (key = 1) Index Cond: (key = N)
Filter: (age = 20) Filter: (age = N)
(10 rows)
\pset footer on
EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table) WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table)
SELECT 1 FROM r WHERE z < 3; SELECT 1 FROM r WHERE z < 3;
@ -368,21 +369,22 @@ EXPLAIN (COSTS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20;
Filter: (age = 20) Filter: (age = 20)
(9 rows) (9 rows)
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
QUERY PLAN select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20');
explain_filter
--------------------------------------------------------------------- ---------------------------------------------------------------------
Custom Scan (Citus Adaptive) (actual rows=0 loops=1) Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: 1 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
-> Delete on distributed_table_1470001 distributed_table (actual rows=0 loops=1) -> Delete on distributed_table_1470001 distributed_table (actual rows=N loops=N)
-> Index Scan using distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=1 loops=1) -> Index Scan using distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=N loops=N)
Index Cond: (key = 1) Index Cond: (key = N)
Filter: (age = 20) Filter: (age = N)
Trigger for constraint second_distributed_table_key_fkey_1470005: calls=1 Trigger for constraint second_distributed_table_key_fkey_1470005: calls=N
(10 rows)
\pset footer on
-- show that EXPLAIN ANALYZE deleted the row and cascades deletes -- show that EXPLAIN ANALYZE deleted the row and cascades deletes
SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3; SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3;
NOTICE: executing the command locally: SELECT key, value, age FROM local_shard_execution.distributed_table_1470001 distributed_table WHERE ((key OPERATOR(pg_catalog.=) 1) AND (age OPERATOR(pg_catalog.=) 20)) ORDER BY key, value, age NOTICE: executing the command locally: SELECT key, value, age FROM local_shard_execution.distributed_table_1470001 distributed_table WHERE ((key OPERATOR(pg_catalog.=) 1) AND (age OPERATOR(pg_catalog.=) 20)) ORDER BY key, value, age

View File

@ -250,21 +250,22 @@ EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
Filter: (age = 20) Filter: (age = 20)
(8 rows) (8 rows)
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
QUERY PLAN select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20');
explain_filter
--------------------------------------------------------------------- ---------------------------------------------------------------------
Custom Scan (Citus Adaptive) (actual rows=1 loops=1) Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: 1 Task Count: N
Tuple data received from nodes: 14 bytes Tuple data received from nodes: N bytes
Tasks Shown: All Tasks Shown: All
-> Task -> Task
Tuple data received from node: 14 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 distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=1 loops=1) -> Index Scan using distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=N loops=N)
Index Cond: (key = 1) Index Cond: (key = N)
Filter: (age = 20) Filter: (age = N)
(10 rows)
\pset footer on
EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table) WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table)
SELECT 1 FROM r WHERE z < 3; SELECT 1 FROM r WHERE z < 3;
@ -306,20 +307,21 @@ EXPLAIN (COSTS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20;
Filter: (age = 20) Filter: (age = 20)
(9 rows) (9 rows)
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
QUERY PLAN select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20');
explain_filter
--------------------------------------------------------------------- ---------------------------------------------------------------------
Custom Scan (Citus Adaptive) (actual rows=0 loops=1) Custom Scan (Citus Adaptive) (actual rows=N loops=N)
Task Count: 1 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
-> Delete on distributed_table_1500001 distributed_table (actual rows=0 loops=1) -> Delete on distributed_table_1500001 distributed_table (actual rows=N loops=N)
-> Index Scan using distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=1 loops=1) -> Index Scan using distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=N loops=N)
Index Cond: (key = 1) Index Cond: (key = N)
Filter: (age = 20) Filter: (age = N)
(9 rows)
\pset footer on
-- show that EXPLAIN ANALYZE deleted the row -- show that EXPLAIN ANALYZE deleted the row
SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3; SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3;
NOTICE: executing the command locally: SELECT key, value, age FROM local_shard_execution_replicated.distributed_table_1500001 distributed_table WHERE ((key OPERATOR(pg_catalog.=) 1) AND (age OPERATOR(pg_catalog.=) 20)) ORDER BY key, value, age NOTICE: executing the command locally: SELECT key, value, age FROM local_shard_execution_replicated.distributed_table_1500001 distributed_table WHERE ((key OPERATOR(pg_catalog.=) 1) AND (age OPERATOR(pg_catalog.=) 20)) ORDER BY key, value, age

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

@ -732,6 +732,11 @@ declare
begin begin
for ln in execute $1 for ln in execute $1
loop loop
-- PG18 extra line "Index Searches: N" — remove entirely
IF ln ~ '^[[:space:]]*Index[[:space:]]+Searches:[[:space:]]*[0-9]+[[:space:]]*$' THEN
CONTINUE;
END IF;
-- Replace any numeric word with just 'N' -- Replace any numeric word with just 'N'
ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g'); ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g');
-- In sort output, the above won't match units-suffixed numbers -- In sort output, the above won't match units-suffixed numbers

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

@ -141,14 +141,21 @@ SELECT a FROM full_correlated WHERE a>200;
$$ $$
); );
SELECT columnar_test_helpers.uses_custom_scan (
$$ BEGIN;
SELECT a FROM full_correlated WHERE a=0 OR a=5; SET LOCAL enable_indexscan TO 'OFF';
$$ SET LOCAL enable_bitmapscan TO 'OFF';
); SELECT columnar_test_helpers.uses_custom_scan (
$$
SELECT a FROM full_correlated WHERE a=0 OR a=5;
$$
);
ROLLBACK;
BEGIN; BEGIN;
SET LOCAL columnar.enable_custom_scan TO 'OFF'; SET LOCAL columnar.enable_custom_scan TO 'OFF';
SET LOCAL enable_indexscan TO 'OFF';
SET LOCAL enable_bitmapscan TO 'OFF';
SELECT columnar_test_helpers.uses_seq_scan ( SELECT columnar_test_helpers.uses_seq_scan (
$$ $$
SELECT a FROM full_correlated WHERE a=0 OR a=5; SELECT a FROM full_correlated WHERE a=0 OR a=5;
@ -366,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

@ -218,7 +218,9 @@ SET citus.enable_binary_protocol = TRUE;
-- though going through distributed execution -- though going through distributed execution
EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20; EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20');
\pset footer on
EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table) WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table)
@ -226,7 +228,10 @@ SELECT 1 FROM r WHERE z < 3;
EXPLAIN (COSTS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20; EXPLAIN (COSTS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20');
\pset footer on
-- show that EXPLAIN ANALYZE deleted the row and cascades deletes -- show that EXPLAIN ANALYZE deleted the row and cascades deletes
SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3; SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3;
SELECT * FROM second_distributed_table WHERE key = 1 ORDER BY 1,2; SELECT * FROM second_distributed_table WHERE key = 1 ORDER BY 1,2;

View File

@ -183,7 +183,9 @@ SET citus.enable_binary_protocol = TRUE;
-- though going through distributed execution -- though going through distributed execution
EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20; EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20');
\pset footer on
EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table) WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table)
@ -191,7 +193,9 @@ SELECT 1 FROM r WHERE z < 3;
EXPLAIN (COSTS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20; EXPLAIN (COSTS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20;
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20; \pset footer off
select public.explain_filter('EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20');
\pset footer on
-- show that EXPLAIN ANALYZE deleted the row -- show that EXPLAIN ANALYZE deleted the row
SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3; SELECT * FROM distributed_table WHERE key = 1 AND age = 20 ORDER BY 1,2,3;
SELECT * FROM second_distributed_table WHERE key = 1 ORDER BY 1,2; SELECT * FROM second_distributed_table WHERE key = 1 ORDER BY 1,2;

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;

View File

@ -763,6 +763,11 @@ declare
begin begin
for ln in execute $1 for ln in execute $1
loop loop
-- PG18 extra line "Index Searches: N" — remove entirely
IF ln ~ '^[[:space:]]*Index[[:space:]]+Searches:[[:space:]]*[0-9]+[[:space:]]*$' THEN
CONTINUE;
END IF;
-- Replace any numeric word with just 'N' -- Replace any numeric word with just 'N'
ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g'); ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g');
-- In sort output, the above won't match units-suffixed numbers -- In sort output, the above won't match units-suffixed numbers