From 46bef9e39c48d6082b3a36685217a475394e89f6 Mon Sep 17 00:00:00 2001 From: Sait Talha Nisanci Date: Tue, 24 Aug 2021 09:17:24 +0300 Subject: [PATCH] Turn off debug for one query to avoid adding an alternative output --- .../expected/subquery_complex_target_list.out | 13 ++++--------- .../regress/sql/subquery_complex_target_list.sql | 5 +++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/regress/expected/subquery_complex_target_list.out b/src/test/regress/expected/subquery_complex_target_list.out index d53434a76..8ac4fac2e 100644 --- a/src/test/regress/expected/subquery_complex_target_list.out +++ b/src/test/regress/expected/subquery_complex_target_list.out @@ -126,6 +126,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT foo."?column? 2 | 3 | 376 | 101 | 4 | 0 | 2.5 | 273 | 101 | 2.7029702970297 | Wed Nov 22 18:19:49.944985 2017 | Thu Nov 23 17:30:34.635085 2017 | 101 | 17 | 17 (1 row) +-- we reset the client min_messages here to avoid adding an alternative output +-- for pg14 as the output slightly differs. +RESET client_min_messages; -- Expressions inside the aggregates -- parts of the query is inspired by TPCH queries SELECT @@ -167,20 +170,12 @@ FROM events_table WHERE foo.avg != bar.cnt_1 AND baz.cnt_2 != events_table.event_type ORDER BY 1 DESC; -DEBUG: push down of limit count: 3 -DEBUG: generating subplan XXX_1 for subquery SELECT avg(((user_id)::numeric OPERATOR(pg_catalog.*) (5.0 OPERATOR(pg_catalog./) ((value_1)::numeric OPERATOR(pg_catalog.+) 0.1)))) AS avg FROM public.users_table ORDER BY (avg(((user_id)::numeric OPERATOR(pg_catalog.*) (5.0 OPERATOR(pg_catalog./) ((value_1)::numeric OPERATOR(pg_catalog.+) 0.1))))) DESC LIMIT 3 -DEBUG: push down of limit count: 3 -DEBUG: generating subplan XXX_2 for subquery SELECT sum(((((user_id)::numeric OPERATOR(pg_catalog.*) (5.0 OPERATOR(pg_catalog./) (((value_1 OPERATOR(pg_catalog.+) value_2))::numeric OPERATOR(pg_catalog.+) 0.1))))::double precision OPERATOR(pg_catalog.*) value_3)) AS cnt_1 FROM public.users_table ORDER BY (sum(((((user_id)::numeric OPERATOR(pg_catalog.*) (5.0 OPERATOR(pg_catalog./) (((value_1 OPERATOR(pg_catalog.+) value_2))::numeric OPERATOR(pg_catalog.+) 0.1))))::double precision OPERATOR(pg_catalog.*) value_3))) DESC LIMIT 3 -DEBUG: push down of limit count: 4 -DEBUG: generating subplan XXX_3 for subquery SELECT avg(CASE WHEN (user_id OPERATOR(pg_catalog.>) 4) THEN value_1 ELSE NULL::integer END) AS cnt_2, avg(CASE WHEN (user_id OPERATOR(pg_catalog.>) 500) THEN value_1 ELSE NULL::integer END) AS cnt_3, sum(CASE WHEN ((value_1 OPERATOR(pg_catalog.=) 1) OR (value_2 OPERATOR(pg_catalog.=) 1)) THEN 1 ELSE 0 END) AS sum_1, date_part('year'::text, max("time")) AS l_year, strpos((max(user_id))::text, '1'::text) AS pos FROM public.users_table ORDER BY (avg(CASE WHEN (user_id OPERATOR(pg_catalog.>) 4) THEN value_1 ELSE NULL::integer END)) DESC LIMIT 4 -DEBUG: push down of limit count: 25 -DEBUG: generating subplan XXX_4 for subquery SELECT COALESCE(value_3, (20)::double precision) AS count_pay FROM public.users_table ORDER BY COALESCE(value_3, (20)::double precision) OFFSET 20 LIMIT 5 -DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT DISTINCT ON (foo.avg) foo.avg, bar.cnt_1, baz.cnt_2, baz.cnt_3, baz.sum_1, baz.l_year, baz.pos, tar.count_pay FROM (SELECT intermediate_result.avg FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(avg numeric)) foo, (SELECT intermediate_result.cnt_1 FROM read_intermediate_result('XXX_2'::text, 'binary'::citus_copy_format) intermediate_result(cnt_1 double precision)) bar, (SELECT intermediate_result.cnt_2, intermediate_result.cnt_3, intermediate_result.sum_1, intermediate_result.l_year, intermediate_result.pos FROM read_intermediate_result('XXX_3'::text, 'binary'::citus_copy_format) intermediate_result(cnt_2 numeric, cnt_3 numeric, sum_1 bigint, l_year double precision, pos integer)) baz, (SELECT intermediate_result.count_pay FROM read_intermediate_result('XXX_4'::text, 'binary'::citus_copy_format) intermediate_result(count_pay double precision)) tar, public.events_table WHERE (((foo.avg)::double precision OPERATOR(pg_catalog.<>) bar.cnt_1) AND (baz.cnt_2 OPERATOR(pg_catalog.<>) (events_table.event_type)::numeric)) ORDER BY foo.avg DESC avg | cnt_1 | cnt_2 | cnt_3 | sum_1 | l_year | pos | count_pay --------------------------------------------------------------------- 30.14666771571734992301 | 3308.14619815793 | 2.5000000000000000 | | 31 | 2017 | 0 | 1 (1 row) +SET client_min_messages TO DEBUG1; -- Multiple columns in GROUP BYs -- foo needs to be recursively planned, bar can be pushded down SELECT diff --git a/src/test/regress/sql/subquery_complex_target_list.sql b/src/test/regress/sql/subquery_complex_target_list.sql index d2d3a2c5e..1579ff017 100644 --- a/src/test/regress/sql/subquery_complex_target_list.sql +++ b/src/test/regress/sql/subquery_complex_target_list.sql @@ -87,6 +87,9 @@ FROM ) as baz ORDER BY 1 DESC; +-- we reset the client min_messages here to avoid adding an alternative output +-- for pg14 as the output slightly differs. +RESET client_min_messages; -- Expressions inside the aggregates -- parts of the query is inspired by TPCH queries SELECT @@ -128,6 +131,8 @@ FROM events_table WHERE foo.avg != bar.cnt_1 AND baz.cnt_2 != events_table.event_type ORDER BY 1 DESC; +SET client_min_messages TO DEBUG1; + -- Multiple columns in GROUP BYs -- foo needs to be recursively planned, bar can be pushded down