update some tests

pull/3900/head
Sait Talha Nisanci 2020-06-08 22:38:53 +03:00
parent 6ad708642e
commit 17388e2e91
6 changed files with 4412 additions and 152 deletions

View File

@ -15,7 +15,7 @@ SHOW server_version \gset
SELECT substring(:'server_version', '\d+')::int; SELECT substring(:'server_version', '\d+')::int;
substring substring
--------------------------------------------------------------------- ---------------------------------------------------------------------
12 13
(1 row) (1 row)
SET client_min_messages TO DEBUG; SET client_min_messages TO DEBUG;
@ -747,8 +747,8 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: (SELECT intermediate
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test29 | {"f1": 29, "f2": 522, "f3": "test29"} | 1
9 | test9 | {"f1": 9, "f2": 162, "f3": "test9"} | 1 9 | test9 | {"f1": 9, "f2": 162, "f3": "test9"} | 1
9 | test29 | {"f1": 29, "f2": 522, "f3": "test29"} | 1
9 | test19 | {"f1": 19, "f2": 342, "f3": "test19"} | 1 9 | test19 | {"f1": 19, "f2": 342, "f3": "test19"} | 1
(3 rows) (3 rows)

View File

@ -15,7 +15,7 @@ SHOW server_version \gset
SELECT substring(:'server_version', '\d+')::int; SELECT substring(:'server_version', '\d+')::int;
substring substring
--------------------------------------------------------------------- ---------------------------------------------------------------------
11 12
(1 row) (1 row)
SET client_min_messages TO DEBUG; SET client_min_messages TO DEBUG;
@ -48,7 +48,19 @@ SELECT
FROM FROM
cte_1 cte_1
ORDER BY 2 DESC LIMIT 1; ORDER BY 2 DESC LIMIT 1;
ERROR: syntax error at or near "NOT" DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: generating subplan XXX_1 for CTE cte_1: SELECT key, value, other_value FROM cte_inline.test_table
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, other_value, (SELECT 1) FROM (SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb)) cte_1 ORDER BY value DESC LIMIT 1
DEBUG: Creating router plan
DEBUG: Plan is router executable
key | value | other_value | ?column?
---------------------------------------------------------------------
9 | test99 | {"f1": 99, "f2": 1782, "f3": "test99"} | 1
(1 row)
-- the cte can be inlined because the unsupported -- the cte can be inlined because the unsupported
-- part of the query (subquery in WHERE clause) -- part of the query (subquery in WHERE clause)
-- doesn't access the cte -- doesn't access the cte
@ -292,7 +304,9 @@ FROM
WHERE WHERE
key = 1; key = 1;
DEBUG: CTE a is going to be inlined via distributed planning DEBUG: CTE a is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Creating router plan
DEBUG: Plan is router executable
DETAIL: distribution column value: 1
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
10 10
@ -306,7 +320,15 @@ FROM
a a
WHERE WHERE
key = 1; key = 1;
ERROR: syntax error at or near "NOT" DEBUG: CTE a is going to be inlined via distributed planning
DEBUG: Creating router plan
DEBUG: Plan is router executable
DETAIL: distribution column value: 1
count
---------------------------------------------------------------------
10
(1 row)
-- using MATERIALIZED should cause inlining not to happen -- using MATERIALIZED should cause inlining not to happen
WITH a AS MATERIALIZED (SELECT * FROM test_table) WITH a AS MATERIALIZED (SELECT * FROM test_table)
SELECT SELECT
@ -315,7 +337,17 @@ FROM
a a
WHERE WHERE
key = 1; key = 1;
ERROR: syntax error at or near "MATERIALIZED" DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: generating subplan XXX_1 for CTE a: SELECT key, value, other_value FROM cte_inline.test_table
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb)) a WHERE (key OPERATOR(pg_catalog.=) 1)
DEBUG: Creating router plan
DEBUG: Plan is router executable
count
---------------------------------------------------------------------
10
(1 row)
-- EXPLAIN should show the difference between materialized an not materialized -- EXPLAIN should show the difference between materialized an not materialized
EXPLAIN (COSTS OFF) WITH a AS (SELECT * FROM test_table) EXPLAIN (COSTS OFF) WITH a AS (SELECT * FROM test_table)
SELECT SELECT
@ -325,19 +357,20 @@ FROM
WHERE WHERE
key = 1; key = 1;
DEBUG: CTE a is going to be inlined via distributed planning DEBUG: CTE a is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Creating router plan
DEBUG: Plan is router executable
DETAIL: distribution column value: 1
QUERY PLAN QUERY PLAN
--------------------------------------------------------------------- ---------------------------------------------------------------------
Aggregate Custom Scan (Citus Adaptive)
-> Custom Scan (Citus Adaptive) Task Count: 1
Task Count: 4 Tasks Shown: All
Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=xxxxx dbname=regression
-> Aggregate -> Aggregate
-> Seq Scan on test_table_1960000 test_table -> Seq Scan on test_table_1960000 test_table
Filter: (key = 1) Filter: (key = 1)
(9 rows) (8 rows)
EXPLAIN (COSTS OFF) WITH a AS MATERIALIZED (SELECT * FROM test_table) EXPLAIN (COSTS OFF) WITH a AS MATERIALIZED (SELECT * FROM test_table)
SELECT SELECT
@ -346,7 +379,31 @@ FROM
a a
WHERE WHERE
key = 1; key = 1;
ERROR: syntax error at or near "MATERIALIZED" DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: generating subplan XXX_1 for CTE a: SELECT key, value, other_value FROM cte_inline.test_table
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb)) a WHERE (key OPERATOR(pg_catalog.=) 1)
DEBUG: Creating router plan
DEBUG: Plan is router executable
QUERY PLAN
---------------------------------------------------------------------
Custom Scan (Citus Adaptive)
-> Distributed Subplan XXX_1
-> Custom Scan (Citus Adaptive)
Task Count: 4
Tasks Shown: One of 4
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Seq Scan on test_table_1960000 test_table
Task Count: 1
Tasks Shown: All
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Aggregate
-> Function Scan on read_intermediate_result intermediate_result
Filter: (key = 1)
(15 rows)
-- citus should not inline the CTE because it is used multiple times -- citus should not inline the CTE because it is used multiple times
WITH cte_1 AS (SELECT * FROM test_table) WITH cte_1 AS (SELECT * FROM test_table)
SELECT SELECT
@ -375,7 +432,25 @@ FROM
JOIN JOIN
cte_1 as second_entry cte_1 as second_entry
USING (key); USING (key);
ERROR: syntax error at or near "NOT" DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: join prunable for intervals [-2147483648,-1073741825] and [-1073741824,-1]
DEBUG: join prunable for intervals [-2147483648,-1073741825] and [0,1073741823]
DEBUG: join prunable for intervals [-2147483648,-1073741825] and [1073741824,2147483647]
DEBUG: join prunable for intervals [-1073741824,-1] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [-1073741824,-1] and [0,1073741823]
DEBUG: join prunable for intervals [-1073741824,-1] and [1073741824,2147483647]
DEBUG: join prunable for intervals [0,1073741823] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [0,1073741823] and [-1073741824,-1]
DEBUG: join prunable for intervals [0,1073741823] and [1073741824,2147483647]
DEBUG: join prunable for intervals [1073741824,2147483647] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [1073741824,2147483647] and [-1073741824,-1]
DEBUG: join prunable for intervals [1073741824,2147483647] and [0,1073741823]
count
---------------------------------------------------------------------
1021
(1 row)
-- EXPLAIN should show the differences between MATERIALIZED and NOT MATERIALIZED -- EXPLAIN should show the differences between MATERIALIZED and NOT MATERIALIZED
EXPLAIN (COSTS OFF) WITH cte_1 AS (SELECT * FROM test_table) EXPLAIN (COSTS OFF) WITH cte_1 AS (SELECT * FROM test_table)
SELECT SELECT
@ -423,7 +498,36 @@ FROM
JOIN JOIN
cte_1 as second_entry cte_1 as second_entry
USING (key); USING (key);
ERROR: syntax error at or near "NOT" DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: join prunable for intervals [-2147483648,-1073741825] and [-1073741824,-1]
DEBUG: join prunable for intervals [-2147483648,-1073741825] and [0,1073741823]
DEBUG: join prunable for intervals [-2147483648,-1073741825] and [1073741824,2147483647]
DEBUG: join prunable for intervals [-1073741824,-1] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [-1073741824,-1] and [0,1073741823]
DEBUG: join prunable for intervals [-1073741824,-1] and [1073741824,2147483647]
DEBUG: join prunable for intervals [0,1073741823] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [0,1073741823] and [-1073741824,-1]
DEBUG: join prunable for intervals [0,1073741823] and [1073741824,2147483647]
DEBUG: join prunable for intervals [1073741824,2147483647] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [1073741824,2147483647] and [-1073741824,-1]
DEBUG: join prunable for intervals [1073741824,2147483647] and [0,1073741823]
QUERY PLAN
---------------------------------------------------------------------
Aggregate
-> Custom Scan (Citus Adaptive)
Task Count: 4
Tasks Shown: One of 4
-> Task
Node: host=localhost port=xxxxx dbname=regression
-> Aggregate
-> Hash Join
Hash Cond: (test_table.key = test_table_1.key)
-> Seq Scan on test_table_1960000 test_table
-> Hash
-> Seq Scan on test_table_1960000 test_table_1
(12 rows)
-- ctes with volatile functions are not -- ctes with volatile functions are not
-- inlined -- inlined
WITH cte_1 AS (SELECT *, random() FROM test_table) WITH cte_1 AS (SELECT *, random() FROM test_table)
@ -448,7 +552,17 @@ SELECT
count(*) count(*)
FROM FROM
cte_1; cte_1;
ERROR: syntax error at or near "NOT" DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: generating subplan XXX_1 for CTE cte_1: SELECT key, value, other_value, random() AS random FROM cte_inline.test_table
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value, intermediate_result.random FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb, random double precision)) cte_1
DEBUG: Creating router plan
DEBUG: Plan is router executable
count
---------------------------------------------------------------------
101
(1 row)
-- cte_1 should be able to inlined even if -- cte_1 should be able to inlined even if
-- it is used one level below -- it is used one level below
WITH cte_1 AS (SELECT * FROM test_table) WITH cte_1 AS (SELECT * FROM test_table)
@ -504,11 +618,11 @@ SELECT count(*)
LEFT JOIN test_table u2 ON u2.key = bar.key) AS foo ON TRUE; LEFT JOIN test_table u2 ON u2.key = bar.key) AS foo ON TRUE;
DEBUG: CTE bar is going to be inlined via distributed planning DEBUG: CTE bar is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: skipping recursive planning for the subquery since it contains references to outer queries count
DEBUG: skipping recursive planning for the subquery since it contains references to outer queries ---------------------------------------------------------------------
DEBUG: skipping recursive planning for the subquery since it contains references to outer queries 10331
DEBUG: Router planner cannot handle multi-shard select queries (1 row)
ERROR: CTEs that refer to other subqueries are not supported in multi-shard queries
-- inlined CTE contains a reference to outer query -- inlined CTE contains a reference to outer query
-- should be fine (even if the recursive planning fails -- should be fine (even if the recursive planning fails
-- to recursively plan the query) -- to recursively plan the query)
@ -581,7 +695,9 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Creating router plan
DEBUG: Plan is router executable
DETAIL: distribution column value: 1
count | key count | key
--------------------------------------------------------------------- ---------------------------------------------------------------------
(0 rows) (0 rows)
@ -695,17 +811,11 @@ FROM
cte LEFT JOIN test_table USING (key); cte LEFT JOIN test_table USING (key);
DEBUG: CTE cte is going to be inlined via distributed planning DEBUG: CTE cte is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Router planner cannot handle multi-shard select queries count
DEBUG: generating subplan XXX_1 for subquery SELECT key, value, other_value FROM cte_inline.test_table ---------------------------------------------------------------------
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM ((SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb)) cte LEFT JOIN cte_inline.test_table USING (key)) 1021
DEBUG: Router planner cannot handle multi-shard select queries (1 row)
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: generating subplan XXX_1 for CTE cte: SELECT key, value, other_value FROM cte_inline.test_table
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM ((SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb)) cte LEFT JOIN cte_inline.test_table USING (key))
DEBUG: Router planner cannot handle multi-shard select queries
ERROR: cannot pushdown the subquery
DETAIL: Complex subqueries and CTEs cannot be in the outer part of the outer join
-- the CTEs are very simple, so postgres -- the CTEs are very simple, so postgres
-- can pull-up the subqueries after inlining -- can pull-up the subqueries after inlining
-- the CTEs, and the query that we send to workers -- the CTEs, and the query that we send to workers
@ -719,10 +829,18 @@ FROM
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: CTE cte_2 is going to be inlined via distributed planning DEBUG: CTE cte_2 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: join prunable for intervals [-2147483648,-1073741825] and [-1073741824,-1]
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM cte_inline.test_table DEBUG: join prunable for intervals [-2147483648,-1073741825] and [0,1073741823]
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM ((SELECT test_table.key FROM cte_inline.test_table) cte_1 JOIN (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) cte_2 USING (key)) DEBUG: join prunable for intervals [-2147483648,-1073741825] and [1073741824,2147483647]
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: join prunable for intervals [-1073741824,-1] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [-1073741824,-1] and [0,1073741823]
DEBUG: join prunable for intervals [-1073741824,-1] and [1073741824,2147483647]
DEBUG: join prunable for intervals [0,1073741823] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [0,1073741823] and [-1073741824,-1]
DEBUG: join prunable for intervals [0,1073741823] and [1073741824,2147483647]
DEBUG: join prunable for intervals [1073741824,2147483647] and [-2147483648,-1073741825]
DEBUG: join prunable for intervals [1073741824,2147483647] and [-1073741824,-1]
DEBUG: join prunable for intervals [1073741824,2147483647] and [0,1073741823]
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
1021 1021
@ -778,7 +896,12 @@ DEBUG: Creating router plan
-- we de still don't support it -- we de still don't support it
WITH cte_1 AS NOT MATERIALIZED (SELECT * FROM test_table) WITH cte_1 AS NOT MATERIALIZED (SELECT * FROM test_table)
DELETE FROM test_table WHERE key NOT IN (SELECT key FROM cte_1); DELETE FROM test_table WHERE key NOT IN (SELECT key FROM cte_1);
ERROR: syntax error at or near "NOT" DEBUG: complex joins are only supported when all distributed tables are co-located and joined on their distribution columns
DEBUG: generating subplan XXX_1 for CTE cte_1: SELECT key, value, other_value FROM cte_inline.test_table
DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: Plan XXX query after replacing subqueries and CTEs: DELETE FROM cte_inline.test_table WHERE (NOT (key OPERATOR(pg_catalog.=) ANY (SELECT cte_1.key FROM (SELECT intermediate_result.key, intermediate_result.value, intermediate_result.other_value FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer, value text, other_value jsonb)) cte_1)))
DEBUG: Creating router plan
DEBUG: Plan is router executable
-- we don't inline CTEs if they are modifying CTEs -- we don't inline CTEs if they are modifying CTEs
WITH cte_1 AS (DELETE FROM test_table WHERE key % 3 = 1 RETURNING key) WITH cte_1 AS (DELETE FROM test_table WHERE key % 3 = 1 RETURNING key)
SELECT * FROM cte_1 ORDER BY 1 DESC LIMIT 3; SELECT * FROM cte_1 ORDER BY 1 DESC LIMIT 3;
@ -797,7 +920,18 @@ DEBUG: Creating router plan
-- NOT MATERIALIZED should not affect modifying CTEs -- NOT MATERIALIZED should not affect modifying CTEs
WITH cte_1 AS NOT MATERIALIZED (DELETE FROM test_table WHERE key % 3 = 0 RETURNING key) WITH cte_1 AS NOT MATERIALIZED (DELETE FROM test_table WHERE key % 3 = 0 RETURNING key)
SELECT count(*) FROM cte_1; SELECT count(*) FROM cte_1;
ERROR: syntax error at or near "NOT" DEBUG: data-modifying statements are not supported in the WITH clauses of distributed queries
DEBUG: generating subplan XXX_1 for CTE cte_1: DELETE FROM cte_inline.test_table WHERE ((key OPERATOR(pg_catalog.%) 3) OPERATOR(pg_catalog.=) 0) RETURNING key
DEBUG: Creating router plan
DEBUG: Plan is router executable
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) cte_1
DEBUG: Creating router plan
DEBUG: Plan is router executable
count
---------------------------------------------------------------------
164
(1 row)
-- cte with column aliases -- cte with column aliases
SELECT * FROM test_table, SELECT * FROM test_table,
(WITH cte_1 (x,y) AS (SELECT * FROM test_table), (WITH cte_1 (x,y) AS (SELECT * FROM test_table),
@ -815,11 +949,11 @@ DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: push down of limit count: 5 DEBUG: push down of limit count: 5
key | value | other_value | z | y | key | t | m | cte_2_key key | value | other_value | z | y | key | t | m | cte_2_key
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | 0 | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | 0 2 | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | 2 | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | 2
0 | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | 0 | test0 | | 0 2 | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | 2 | test12 | | 2
0 | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | 0 | test0 | | 0 2 | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | 2 | test12 | | 2
0 | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | 0 | test0 | | 0 2 | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | 2 | test12 | | 2
0 | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | test0 | {"f1": 0, "f2": 0, "f3": "test0"} | 0 | test10 | {"f1": 10, "f2": 180, "f3": "test10"} | 0 2 | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | test12 | {"f1": 12, "f2": 216, "f3": "test12"} | 2 | test15 | {"f1": 15, "f2": 270, "f3": "test15"} | 5
(5 rows) (5 rows)
-- cte used in HAVING subquery just works fine -- cte used in HAVING subquery just works fine
@ -843,12 +977,10 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, count(*)
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
key | count key | count
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 | 44
9 | 40
8 | 40 8 | 40
6 | 40
5 | 40 5 | 40
(5 rows) 2 | 40
(3 rows)
-- cte used in ORDER BY just works fine -- cte used in ORDER BY just works fine
-- even if it is inlined -- even if it is inlined
@ -869,9 +1001,9 @@ DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: push down of limit count: 3 DEBUG: push down of limit count: 3
key key
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 8
9 8
9 8
(3 rows) (3 rows)
PREPARE inlined_cte_without_params AS PREPARE inlined_cte_without_params AS
@ -904,7 +1036,7 @@ DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: push down of limit count: 3 DEBUG: push down of limit count: 3
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
44 40
40 40
40 40
(3 rows) (3 rows)
@ -912,7 +1044,7 @@ DEBUG: push down of limit count: 3
EXECUTE inlined_cte_without_params; EXECUTE inlined_cte_without_params;
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
44 40
40 40
40 40
(3 rows) (3 rows)
@ -920,7 +1052,7 @@ EXECUTE inlined_cte_without_params;
EXECUTE inlined_cte_without_params; EXECUTE inlined_cte_without_params;
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
44 40
40 40
40 40
(3 rows) (3 rows)
@ -928,7 +1060,7 @@ EXECUTE inlined_cte_without_params;
EXECUTE inlined_cte_without_params; EXECUTE inlined_cte_without_params;
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
44 40
40 40
40 40
(3 rows) (3 rows)
@ -936,7 +1068,7 @@ EXECUTE inlined_cte_without_params;
EXECUTE inlined_cte_without_params; EXECUTE inlined_cte_without_params;
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
44 40
40 40
40 40
(3 rows) (3 rows)
@ -944,7 +1076,7 @@ EXECUTE inlined_cte_without_params;
EXECUTE inlined_cte_without_params; EXECUTE inlined_cte_without_params;
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
44 40
40 40
40 40
(3 rows) (3 rows)
@ -959,49 +1091,49 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_without_params; EXECUTE non_inlined_cte_without_params;
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_without_params; EXECUTE non_inlined_cte_without_params;
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_without_params; EXECUTE non_inlined_cte_without_params;
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_without_params; EXECUTE non_inlined_cte_without_params;
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_without_params; EXECUTE non_inlined_cte_without_params;
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE inlined_cte_has_parameter_on_non_dist_key('test1'); EXECUTE inlined_cte_has_parameter_on_non_dist_key('test1');
@ -1027,8 +1159,7 @@ DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: push down of limit count: 3 DEBUG: push down of limit count: 3
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
4 (0 rows)
(1 row)
EXECUTE inlined_cte_has_parameter_on_non_dist_key('test4'); EXECUTE inlined_cte_has_parameter_on_non_dist_key('test4');
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1055,8 +1186,7 @@ DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: push down of limit count: 3 DEBUG: push down of limit count: 3
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
4 (0 rows)
(1 row)
EXECUTE inlined_cte_has_parameter_on_dist_key(1); EXECUTE inlined_cte_has_parameter_on_dist_key(1);
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1077,8 +1207,7 @@ DEBUG: push down of limit count: 3
--------------------------------------------------------------------- ---------------------------------------------------------------------
40 40
40 40
40 (2 rows)
(3 rows)
EXECUTE inlined_cte_has_parameter_on_dist_key(3); EXECUTE inlined_cte_has_parameter_on_dist_key(3);
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1088,8 +1217,7 @@ DEBUG: push down of limit count: 3
--------------------------------------------------------------------- ---------------------------------------------------------------------
40 40
40 40
40 (2 rows)
(3 rows)
EXECUTE inlined_cte_has_parameter_on_dist_key(4); EXECUTE inlined_cte_has_parameter_on_dist_key(4);
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1099,8 +1227,7 @@ DEBUG: push down of limit count: 3
--------------------------------------------------------------------- ---------------------------------------------------------------------
40 40
40 40
40 (2 rows)
(3 rows)
EXECUTE inlined_cte_has_parameter_on_dist_key(5); EXECUTE inlined_cte_has_parameter_on_dist_key(5);
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1109,9 +1236,7 @@ DEBUG: push down of limit count: 3
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
40 40
40 (1 row)
40
(3 rows)
EXECUTE inlined_cte_has_parameter_on_dist_key(6); EXECUTE inlined_cte_has_parameter_on_dist_key(6);
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1122,8 +1247,7 @@ DEBUG: push down of limit count: 3
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
40 40
40 (1 row)
(2 rows)
EXECUTE non_inlined_cte_has_parameter_on_dist_key(1); EXECUTE non_inlined_cte_has_parameter_on_dist_key(1);
DEBUG: CTE cte_1 is going to be inlined via distributed planning DEBUG: CTE cte_1 is going to be inlined via distributed planning
@ -1135,9 +1259,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_has_parameter_on_dist_key(2); EXECUTE non_inlined_cte_has_parameter_on_dist_key(2);
@ -1150,9 +1274,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_has_parameter_on_dist_key(3); EXECUTE non_inlined_cte_has_parameter_on_dist_key(3);
@ -1165,9 +1289,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_has_parameter_on_dist_key(4); EXECUTE non_inlined_cte_has_parameter_on_dist_key(4);
@ -1180,9 +1304,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_has_parameter_on_dist_key(5); EXECUTE non_inlined_cte_has_parameter_on_dist_key(5);
@ -1195,9 +1319,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE non_inlined_cte_has_parameter_on_dist_key(6); EXECUTE non_inlined_cte_has_parameter_on_dist_key(6);
@ -1212,9 +1336,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT key, value, o
DEBUG: Creating router plan DEBUG: Creating router plan
key | value | other_value | ?column? key | value | other_value | ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
9 | test99 | | 1 8 | test98 | | 1
(3 rows) (3 rows)
EXECUTE retry_planning(1); EXECUTE retry_planning(1);
@ -1222,7 +1346,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "2" : "test12", "2" : "test2", "2" : "test22", "2" : "test32", "2" : "test42", "2" : "test52", "2" : "test62", "2" : "test72", "2" : "test82", "2" : "test92", "3" : "test13", "3" : "test23", "3" : "test3", "3" : "test33", "3" : "test43", "3" : "test53", "3" : "test63", "3" : "test73", "3" : "test83", "3" : "test93", "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "6" : "test16", "6" : "test26", "6" : "test36", "6" : "test46", "6" : "test56", "6" : "test6", "6" : "test66", "6" : "test76", "6" : "test86", "6" : "test96", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "2" : "test12", "2" : "test2", "2" : "test22", "2" : "test32", "2" : "test42", "2" : "test52", "2" : "test62", "2" : "test72", "2" : "test82", "2" : "test92", "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
EXECUTE retry_planning(2); EXECUTE retry_planning(2);
@ -1230,7 +1354,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "3" : "test13", "3" : "test23", "3" : "test3", "3" : "test33", "3" : "test43", "3" : "test53", "3" : "test63", "3" : "test73", "3" : "test83", "3" : "test93", "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "6" : "test16", "6" : "test26", "6" : "test36", "6" : "test46", "6" : "test56", "6" : "test6", "6" : "test66", "6" : "test76", "6" : "test86", "6" : "test96", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
EXECUTE retry_planning(3); EXECUTE retry_planning(3);
@ -1238,7 +1362,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "6" : "test16", "6" : "test26", "6" : "test36", "6" : "test46", "6" : "test56", "6" : "test6", "6" : "test66", "6" : "test76", "6" : "test86", "6" : "test96", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
EXECUTE retry_planning(4); EXECUTE retry_planning(4);
@ -1246,7 +1370,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "6" : "test16", "6" : "test26", "6" : "test36", "6" : "test46", "6" : "test56", "6" : "test6", "6" : "test66", "6" : "test76", "6" : "test86", "6" : "test96", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
EXECUTE retry_planning(5); EXECUTE retry_planning(5);
@ -1254,7 +1378,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "6" : "test16", "6" : "test26", "6" : "test36", "6" : "test46", "6" : "test56", "6" : "test6", "6" : "test66", "6" : "test76", "6" : "test86", "6" : "test96", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
EXECUTE retry_planning(6); EXECUTE retry_planning(6);
@ -1264,7 +1388,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
-- this test can only work if the CTE is recursively -- this test can only work if the CTE is recursively
@ -1286,7 +1410,7 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS c
DEBUG: Creating router plan DEBUG: Creating router plan
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
11536 4800
(1 row) (1 row)
-- this becomes a non-colocated subquery join -- this becomes a non-colocated subquery join
@ -1304,7 +1428,7 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS c
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
count count
--------------------------------------------------------------------- ---------------------------------------------------------------------
1136 480
(1 row) (1 row)
-- cte a has to be recursively planned because of OFFSET 0 -- cte a has to be recursively planned because of OFFSET 0
@ -1328,7 +1452,7 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT min(a.key) AS
DEBUG: Creating router plan DEBUG: Creating router plan
min min
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 2
(1 row) (1 row)
-- after both CTEs are inlined, this becomes non-colocated subquery join -- after both CTEs are inlined, this becomes non-colocated subquery join
@ -1345,9 +1469,9 @@ DEBUG: Router planner cannot handle multi-shard select queries
DEBUG: push down of limit count: 3 DEBUG: push down of limit count: 3
key | value | other_value | key | value | other_value key | value | other_value | key | value | other_value
--------------------------------------------------------------------- ---------------------------------------------------------------------
0 | test10 | {"f1": 10, "f2": 180, "f3": "test10"} | 0 | test0 | 2 | test2 | {"f1": 2, "f2": 36, "f3": "test2"} | 2 | test12 |
0 | test10 | {"f1": 10, "f2": 180, "f3": "test10"} | 0 | test0 | 2 | test2 | {"f1": 2, "f2": 36, "f3": "test2"} | 2 | test12 |
0 | test10 | {"f1": 10, "f2": 180, "f3": "test10"} | 0 | test0 | 2 | test2 | {"f1": 2, "f2": 36, "f3": "test2"} | 2 | test12 |
(3 rows) (3 rows)
-- full join is only supported when both sides are -- full join is only supported when both sides are
@ -1371,9 +1495,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT value FROM ((
DEBUG: Creating router plan DEBUG: Creating router plan
value value
--------------------------------------------------------------------- ---------------------------------------------------------------------
test99 test98
test99 test98
test99 test98
(3 rows) (3 rows)
-- an unsupported agg. for multi-shard queries -- an unsupported agg. for multi-shard queries
@ -1384,7 +1508,7 @@ DEBUG: CTE cte_1 is going to be inlined via distributed planning
DEBUG: Router planner cannot handle multi-shard select queries DEBUG: Router planner cannot handle multi-shard select queries
json_object_agg json_object_agg
--------------------------------------------------------------------- ---------------------------------------------------------------------
{ "2" : "test12", "2" : "test2", "2" : "test22", "2" : "test32", "2" : "test42", "2" : "test52", "2" : "test62", "2" : "test72", "2" : "test82", "2" : "test92", "3" : "test13", "3" : "test23", "3" : "test3", "3" : "test33", "3" : "test43", "3" : "test53", "3" : "test63", "3" : "test73", "3" : "test83", "3" : "test93", "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "6" : "test16", "6" : "test26", "6" : "test36", "6" : "test46", "6" : "test56", "6" : "test6", "6" : "test66", "6" : "test76", "6" : "test86", "6" : "test96", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98", "9" : "test19", "9" : "test29", "9" : "test39", "9" : "test49", "9" : "test59", "9" : "test69", "9" : "test79", "9" : "test89", "9" : "test9", "9" : "test99" } { "2" : "test12", "2" : "test2", "2" : "test22", "2" : "test32", "2" : "test42", "2" : "test52", "2" : "test62", "2" : "test72", "2" : "test82", "2" : "test92", "5" : "test15", "5" : "test25", "5" : "test35", "5" : "test45", "5" : "test5", "5" : "test55", "5" : "test65", "5" : "test75", "5" : "test85", "5" : "test95", "8" : "test18", "8" : "test28", "8" : "test38", "8" : "test48", "8" : "test58", "8" : "test68", "8" : "test78", "8" : "test8", "8" : "test88", "8" : "test98" }
(1 row) (1 row)
-- both cte_1 and cte_2 are going to be inlined. -- both cte_1 and cte_2 are going to be inlined.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -958,12 +958,10 @@ EXPLAIN (COSTS FALSE)
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=xxxxx dbname=regression
-> GroupAggregate -> HashAggregate
Group Key: l_orderkey Group Key: l_orderkey
-> Sort
Sort Key: l_orderkey
-> Seq Scan on lineitem_hash_part_360041 lineitem_hash_part -> Seq Scan on lineitem_hash_part_360041 lineitem_hash_part
(15 rows) (13 rows)
-- check the plan if the hash aggreate is disabled. -- check the plan if the hash aggreate is disabled.
SET enable_hashagg TO off; SET enable_hashagg TO off;
@ -984,12 +982,10 @@ EXPLAIN (COSTS FALSE)
Tasks Shown: One of 4 Tasks Shown: One of 4
-> Task -> Task
Node: host=localhost port=xxxxx dbname=regression Node: host=localhost port=xxxxx dbname=regression
-> GroupAggregate -> HashAggregate
Group Key: l_orderkey Group Key: l_orderkey
-> Sort
Sort Key: l_orderkey
-> Seq Scan on lineitem_hash_part_360041 lineitem_hash_part -> Seq Scan on lineitem_hash_part_360041 lineitem_hash_part
(14 rows) (12 rows)
SET enable_hashagg TO on; SET enable_hashagg TO on;
-- distinct on non-partition column with aggregate -- distinct on non-partition column with aggregate

File diff suppressed because it is too large Load Diff