From 9243b5992b2839ddaf6e4f87140403fbddafcbfb Mon Sep 17 00:00:00 2001 From: paragjain Date: Sat, 13 Jul 2024 07:24:44 +0000 Subject: [PATCH] indent --- src/test/regress/expected/merge_vcore.out | 84 ++++++++++----------- src/test/regress/expected/merge_vcore_0.out | 6 ++ src/test/regress/sql/merge_vcore.sql | 36 ++++----- 3 files changed, 66 insertions(+), 60 deletions(-) create mode 100644 src/test/regress/expected/merge_vcore_0.out diff --git a/src/test/regress/expected/merge_vcore.out b/src/test/regress/expected/merge_vcore.out index 91fd49330..64d50079b 100644 --- a/src/test/regress/expected/merge_vcore.out +++ b/src/test/regress/expected/merge_vcore.out @@ -81,19 +81,19 @@ SELECT * FROM target; (2 rows) -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- - Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0) + Custom Scan (Citus MERGE INTO ...) MERGE INTO target method: pull to coordinator - -> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0) + -> Custom Scan (Citus Adaptive) Task Count: 1 Tasks Shown: All -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000000 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000000 source (8 rows) DROP TABLE IF EXISTS source; @@ -151,19 +151,19 @@ SELECT * FROM target; (2 rows) -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- - Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0) + Custom Scan (Citus MERGE INTO ...) MERGE INTO target method: pull to coordinator - -> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0) + -> Custom Scan (Citus Adaptive) Task Count: 1 Tasks Shown: All -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000002 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000002 source (8 rows) DROP TABLE IF EXISTS source; @@ -221,28 +221,28 @@ SELECT * FROM target; (2 rows) -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- - Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0) + Custom Scan (Citus MERGE INTO ...) MERGE INTO target method: pull to coordinator - -> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=40) + -> Custom Scan (Citus Adaptive) Task Count: 4 Tasks Shown: All -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000007 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000007 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000008 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000008 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000009 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000009 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000010 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000010 source (17 rows) DROP TABLE IF EXISTS source; @@ -300,28 +300,28 @@ SELECT * FROM target; (2 rows) -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- - Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0) + Custom Scan (Citus MERGE INTO ...) MERGE INTO target method: repartition - -> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=40) + -> Custom Scan (Citus Adaptive) Task Count: 4 Tasks Shown: All -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000012 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000012 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000013 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000013 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000014 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000014 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000015 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000015 source (17 rows) DROP TABLE IF EXISTS source; @@ -379,28 +379,28 @@ SELECT * FROM target; (2 rows) -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- - Custom Scan (Citus MERGE INTO ...) (cost=0.00..0.00 rows=0 width=0) + Custom Scan (Citus MERGE INTO ...) MERGE INTO target method: repartition - -> Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=100000 width=40) + -> Custom Scan (Citus Adaptive) Task Count: 4 Tasks Shown: All -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000020 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000020 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000021 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000021 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000022 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000022 source -> Task Node: host=localhost port=xxxxx dbname=regression - -> Seq Scan on source_4000023 source (cost=0.00..22.00 rows=1200 width=40) + -> Seq Scan on source_4000023 source (17 rows) DROP TABLE IF EXISTS source; @@ -458,21 +458,21 @@ SELECT * FROM target; (2 rows) -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- - Custom Scan (Citus Adaptive) (cost=0.00..0.00 rows=0 width=0) + Custom Scan (Citus Adaptive) Task Count: 1 Tasks Shown: All -> Task Node: host=localhost port=xxxxx dbname=regression - -> Merge on target_4000029 target (cost=0.00..137.01 rows=0 width=0) - -> Nested Loop (cost=0.00..137.01 rows=7200 width=6) - -> Seq Scan on source_4000028 source (cost=0.00..22.00 rows=1200 width=0) - -> Materialize (cost=0.00..25.03 rows=6 width=6) - -> Seq Scan on target_4000029 target (cost=0.00..25.00 rows=6 width=6) + -> Merge on target_4000029 target + -> Nested Loop + -> Seq Scan on source_4000028 source + -> Materialize + -> Seq Scan on target_4000029 target Filter: ('2'::bigint = id) (11 rows) diff --git a/src/test/regress/expected/merge_vcore_0.out b/src/test/regress/expected/merge_vcore_0.out new file mode 100644 index 000000000..a7e3fbf20 --- /dev/null +++ b/src/test/regress/expected/merge_vcore_0.out @@ -0,0 +1,6 @@ +SHOW server_version \gset +SELECT substring(:'server_version', '\d+')::int >= 15 AS server_version_ge_15 +\gset +\if :server_version_ge_15 +\else +\q diff --git a/src/test/regress/sql/merge_vcore.sql b/src/test/regress/sql/merge_vcore.sql index f4ef4cb80..77ee81e8d 100644 --- a/src/test/regress/sql/merge_vcore.sql +++ b/src/test/regress/sql/merge_vcore.sql @@ -43,7 +43,7 @@ SELECT create_distributed_table('target', null, colocate_with=>'none'); INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}'); -- insert -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -54,7 +54,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- update -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -65,7 +65,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; @@ -91,7 +91,7 @@ SELECT create_distributed_table('target', 'id'); INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}'); -- insert -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -102,7 +102,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- update -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -113,7 +113,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; @@ -140,7 +140,7 @@ SELECT create_distributed_table('target', null); INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}'); -- insert -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -151,7 +151,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- update -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -162,7 +162,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; @@ -187,7 +187,7 @@ SELECT create_distributed_table('target', 'id'); INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}'); -- insert -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -198,7 +198,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- update -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -209,7 +209,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; @@ -235,7 +235,7 @@ SELECT create_distributed_table('target', 'id', colocate_with=>'source'); INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}'); -- insert -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -246,7 +246,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- update -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -257,7 +257,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING; @@ -283,7 +283,7 @@ SELECT create_distributed_table('target', null, colocate_with=>'source'); INSERT INTO source (id, doc) VALUES (1, '{"a" : 1}'), (1, '{"a" : 2}'); -- insert -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -294,7 +294,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- update -MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) AND src.doc = target.doc WHEN MATCHED THEN UPDATE SET doc = '{"b" : 1}' @@ -305,7 +305,7 @@ VALUES (src.t_id, doc); SELECT * FROM target; -- Explain -EXPLAIN MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src +EXPLAIN (costs off, timing off, summary off) MERGE INTO ONLY target USING (SELECT 2::bigint AS t_id, doc FROM source) src ON (src.t_id = target.id) WHEN MATCHED THEN DO NOTHING;