mirror of https://github.com/citusdata/citus.git
Hide EXPLAIN ANALYZE output in tests to prevent "Index Searches" line from being printed for PG18 compatibility
parent
daa69bec8f
commit
1216ccd939
|
|
@ -376,9 +376,6 @@ s/\<is referenced from table\>/is still referenced from table/g
|
|||
# ignore any "find_in_path:" lines in test output
|
||||
/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
|
||||
# this rule can be removed when PG18 is the minimum supported version
|
||||
/^[ \t]*Storage:[ \t].*$/d
|
||||
|
|
|
|||
|
|
@ -312,21 +312,22 @@ EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
|
|||
Filter: (age = 20)
|
||||
(8 rows)
|
||||
|
||||
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
|
||||
QUERY PLAN
|
||||
\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');
|
||||
explain_filter
|
||||
---------------------------------------------------------------------
|
||||
Custom Scan (Citus Adaptive) (actual rows=1 loops=1)
|
||||
Task Count: 1
|
||||
Tuple data received from nodes: 14 bytes
|
||||
Custom Scan (Citus Adaptive) (actual rows=N loops=N)
|
||||
Task Count: N
|
||||
Tuple data received from nodes: N bytes
|
||||
Tasks Shown: All
|
||||
-> Task
|
||||
Tuple data received from node: 14 bytes
|
||||
Node: host=localhost port=xxxxx dbname=regression
|
||||
-> Index Scan using distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=1 loops=1)
|
||||
Index Cond: (key = 1)
|
||||
Filter: (age = 20)
|
||||
(10 rows)
|
||||
Tuple data received from node: N bytes
|
||||
Node: host=localhost port=N dbname=regression
|
||||
-> Index Scan using distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=N loops=N)
|
||||
Index Cond: (key = N)
|
||||
Filter: (age = N)
|
||||
|
||||
\pset footer on
|
||||
EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
|
||||
WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table)
|
||||
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)
|
||||
(9 rows)
|
||||
|
||||
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20;
|
||||
QUERY PLAN
|
||||
\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');
|
||||
explain_filter
|
||||
---------------------------------------------------------------------
|
||||
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
|
||||
-> Task
|
||||
Node: host=localhost port=xxxxx dbname=regression
|
||||
-> Delete on distributed_table_1470001 distributed_table (actual rows=0 loops=1)
|
||||
-> Index Scan using distributed_table_pkey_1470001 on distributed_table_1470001 distributed_table (actual rows=1 loops=1)
|
||||
Index Cond: (key = 1)
|
||||
Filter: (age = 20)
|
||||
Trigger for constraint second_distributed_table_key_fkey_1470005: calls=1
|
||||
(10 rows)
|
||||
Node: host=localhost port=N dbname=regression
|
||||
-> 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=N loops=N)
|
||||
Index Cond: (key = N)
|
||||
Filter: (age = N)
|
||||
Trigger for constraint second_distributed_table_key_fkey_1470005: calls=N
|
||||
|
||||
\pset footer on
|
||||
-- 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;
|
||||
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
|
||||
|
|
|
|||
|
|
@ -250,21 +250,22 @@ EXPLAIN (COSTS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
|
|||
Filter: (age = 20)
|
||||
(8 rows)
|
||||
|
||||
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) SELECT * FROM distributed_table WHERE key = 1 AND age = 20;
|
||||
QUERY PLAN
|
||||
\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');
|
||||
explain_filter
|
||||
---------------------------------------------------------------------
|
||||
Custom Scan (Citus Adaptive) (actual rows=1 loops=1)
|
||||
Task Count: 1
|
||||
Tuple data received from nodes: 14 bytes
|
||||
Custom Scan (Citus Adaptive) (actual rows=N loops=N)
|
||||
Task Count: N
|
||||
Tuple data received from nodes: N bytes
|
||||
Tasks Shown: All
|
||||
-> Task
|
||||
Tuple data received from node: 14 bytes
|
||||
Node: host=localhost port=xxxxx dbname=regression
|
||||
-> Index Scan using distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=1 loops=1)
|
||||
Index Cond: (key = 1)
|
||||
Filter: (age = 20)
|
||||
(10 rows)
|
||||
Tuple data received from node: N bytes
|
||||
Node: host=localhost port=N dbname=regression
|
||||
-> Index Scan using distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=N loops=N)
|
||||
Index Cond: (key = N)
|
||||
Filter: (age = N)
|
||||
|
||||
\pset footer on
|
||||
EXPLAIN (ANALYZE ON, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF)
|
||||
WITH r AS ( SELECT GREATEST(random(), 2) z,* FROM distributed_table)
|
||||
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)
|
||||
(9 rows)
|
||||
|
||||
EXPLAIN (ANALYZE, COSTS OFF, SUMMARY OFF, TIMING OFF, BUFFERS OFF) DELETE FROM distributed_table WHERE key = 1 AND age = 20;
|
||||
QUERY PLAN
|
||||
\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');
|
||||
explain_filter
|
||||
---------------------------------------------------------------------
|
||||
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
|
||||
-> Task
|
||||
Node: host=localhost port=xxxxx dbname=regression
|
||||
-> Delete on distributed_table_1500001 distributed_table (actual rows=0 loops=1)
|
||||
-> Index Scan using distributed_table_pkey_1500001 on distributed_table_1500001 distributed_table (actual rows=1 loops=1)
|
||||
Index Cond: (key = 1)
|
||||
Filter: (age = 20)
|
||||
(9 rows)
|
||||
Node: host=localhost port=N dbname=regression
|
||||
-> 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=N loops=N)
|
||||
Index Cond: (key = N)
|
||||
Filter: (age = N)
|
||||
|
||||
\pset footer on
|
||||
-- show that EXPLAIN ANALYZE deleted the row
|
||||
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
|
||||
|
|
|
|||
|
|
@ -732,6 +732,11 @@ declare
|
|||
begin
|
||||
for ln in execute $1
|
||||
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'
|
||||
ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g');
|
||||
-- In sort output, the above won't match units-suffixed numbers
|
||||
|
|
|
|||
|
|
@ -218,7 +218,9 @@ SET citus.enable_binary_protocol = TRUE;
|
|||
-- though going through distributed execution
|
||||
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)
|
||||
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 (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
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,9 @@ SET citus.enable_binary_protocol = TRUE;
|
|||
-- though going through distributed execution
|
||||
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)
|
||||
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 (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
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -763,6 +763,11 @@ declare
|
|||
begin
|
||||
for ln in execute $1
|
||||
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'
|
||||
ln := regexp_replace(ln, '-?\m\d+\M', 'N', 'g');
|
||||
-- In sort output, the above won't match units-suffixed numbers
|
||||
|
|
|
|||
Loading…
Reference in New Issue