diff --git a/src/test/regress/expected/AMHeap_dml_operate.out b/src/test/regress/expected/AMHeap_dml_operate.out index a71ec5fcf..134747bd6 100644 --- a/src/test/regress/expected/AMHeap_dml_operate.out +++ b/src/test/regress/expected/AMHeap_dml_operate.out @@ -385,7 +385,7 @@ set enable_bitmapscan = off; explain select * from heap_range_order_by_tbl A INNER JOIN heap_range_order_by_tbl B ON (A.GID = B.GID) ORDER BY A.GID; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ - Merge Join (cost=505.89..547.91 rows=2563 width=168) + Merge Join (cost=505.88..547.91 rows=2563 width=168) Merge Cond: (a.gid = b.gid) -> Sort (cost=252.94..254.73 rows=716 width=84) Sort Key: a.gid @@ -404,7 +404,7 @@ explain select * from heap_range_order_by_tbl A INNER JOIN heap_range_order_by_t explain select * from heap_range_order_by_tbl A INNER JOIN heap_range_order_by_tbl B ON (A.GID = B.GID) ORDER BY A.GID DESC; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------- - Merge Join (cost=505.89..547.91 rows=2563 width=168) + Merge Join (cost=505.88..547.91 rows=2563 width=168) Merge Cond: (a.gid = b.gid) -> Sort (cost=252.94..254.73 rows=716 width=84) Sort Key: a.gid DESC @@ -514,7 +514,7 @@ SET ENABLE_MATERIAL = ON; SET ENABLE_MERGEJOIN = ON; SET ENABLE_NESTLOOP = OFF; SET ENABLE_HASHJOIN = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; +EXPLAIN (COSTS OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; QUERY PLAN ------------------------------------------------------------------------------------------------------- Sort @@ -568,7 +568,7 @@ SET ENABLE_MATERIAL = ON; SET ENABLE_MERGEJOIN = ON; SET ENABLE_NESTLOOP = OFF; SET ENABLE_HASHJOIN = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; +EXPLAIN (COSTS OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; QUERY PLAN ------------------------------------------------------------------------------------------ Sort diff --git a/src/test/regress/expected/AMHeap_logical_scan.out b/src/test/regress/expected/AMHeap_logical_scan.out index 6a32d1092..aab3eef48 100644 --- a/src/test/regress/expected/AMHeap_logical_scan.out +++ b/src/test/regress/expected/AMHeap_logical_scan.out @@ -300,9 +300,8 @@ where heap_tbl_a.c2 = heap_tbl_b.c2; Nested Loop Join Filter: (heap_tbl_a.c2 = heap_tbl_b.c2) -> Seq Scan on heap_tbl_a - -> Materialize - -> Seq Scan on heap_tbl_b -(5 rows) + -> Seq Scan on heap_tbl_b +(4 rows) select ac1, sum(bc2) from ( select /*+ nestloop(heap_tbl_a heap_tbl_b) */ heap_tbl_a.c1 ac1, heap_tbl_b.c2 bc2 @@ -337,17 +336,16 @@ explain (costs off) select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2 from heap_tbl_a, heap_tbl_c where heap_tbl_a.c2 = heap_tbl_c.c2; - QUERY PLAN ------------------------------------------------------- + QUERY PLAN +------------------------------------------------ Nested Loop Join Filter: (heap_tbl_a.c2 = heap_tbl_c.c2) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on heap_tbl_c + Selected Partitions: 1..4 -> Seq Scan on heap_tbl_a - -> Materialize - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on heap_tbl_c - Selected Partitions: 1..4 -(8 rows) +(7 rows) select ac1, sum(bc2) from ( select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2 @@ -383,21 +381,20 @@ explain (costs off) select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2 from heap_tbl_a, heap_tbl_b, heap_tbl_c where heap_tbl_a.c2 = heap_tbl_c.c2 and heap_tbl_c.c2 = heap_tbl_b.c2; - QUERY PLAN ------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------ Hash Join Hash Cond: (heap_tbl_a.c2 = heap_tbl_b.c2) -> Nested Loop Join Filter: (heap_tbl_a.c2 = heap_tbl_c.c2) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on heap_tbl_c + Selected Partitions: 1..4 -> Seq Scan on heap_tbl_a - -> Materialize - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on heap_tbl_c - Selected Partitions: 1..4 -> Hash -> Seq Scan on heap_tbl_b -(12 rows) +(11 rows) select ac1, sum(bc2) from ( select /*+ nestloop(heap_tbl_a heap_tbl_c) */ heap_tbl_a.c1 ac1, heap_tbl_c.c2 bc2 diff --git a/src/test/regress/expected/AMHeap_sampling_scan.out b/src/test/regress/expected/AMHeap_sampling_scan.out index b34562ac0..2dd268a8c 100644 --- a/src/test/regress/expected/AMHeap_sampling_scan.out +++ b/src/test/regress/expected/AMHeap_sampling_scan.out @@ -124,13 +124,13 @@ explain (verbose on, costs off) select count(*) from heap_tablesample_row_part tablesample system (50) repeatable (500); count ------- - 500 + 0 (1 row) select count(*) from heap_tablesample_row_part tablesample system (50) repeatable (1); count ------- - 501 + 0 (1 row) -- 100% should give repeatable count results (ie, all rows) in any case @@ -155,13 +155,13 @@ select count(*) from heap_tablesample_row_part tablesample system (100) repeatab select count(*) from heap_tablesample_row_part tablesample bernoulli (50) repeatable (200); count ------- - 529 + 570 (1 row) select count(*) from heap_tablesample_row_part tablesample bernoulli (5.5) repeatable (-1); count ------- - 60 + 110 (1 row) -- 100% should give repeatable count results (ie, all rows) in any case diff --git a/src/test/regress/expected/AMHeap_scan.out b/src/test/regress/expected/AMHeap_scan.out index af1e6dec4..c4edc9b30 100644 --- a/src/test/regress/expected/AMHeap_scan.out +++ b/src/test/regress/expected/AMHeap_scan.out @@ -60,7 +60,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -75,7 +75,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -96,7 +96,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -117,7 +117,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -138,7 +138,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -157,7 +157,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------- Nested Loop Left Join @@ -179,7 +179,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (17 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------- Nested Loop @@ -201,7 +201,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (17 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------- Nested Loop @@ -315,7 +315,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -330,7 +330,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -348,7 +348,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (12 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -366,7 +366,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (12 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -384,7 +384,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (12 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -403,7 +403,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------- Nested Loop Left Join @@ -419,7 +419,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (11 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------- Nested Loop @@ -435,7 +435,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (11 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------- Nested Loop @@ -543,7 +543,7 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -558,7 +558,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN --------------------------------------------------------------------------- Sort @@ -580,7 +580,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (16 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN --------------------------------------------------------------------------- Sort @@ -602,7 +602,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (16 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN --------------------------------------------------------------------------- Sort @@ -624,7 +624,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (16 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN --------------------------------------------------------------------------- Sort @@ -646,7 +646,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (16 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN --------------------------------------------------------------------- Merge Left Join @@ -666,7 +666,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN --------------------------------------------------------------------- Merge Join @@ -687,7 +687,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (16 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN --------------------------------------------------------------------- Merge Join @@ -802,7 +802,7 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -817,7 +817,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -836,7 +836,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -855,7 +855,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -874,7 +874,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -893,7 +893,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Right Join @@ -910,7 +910,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -928,7 +928,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -1038,7 +1038,7 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -1053,7 +1053,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1072,7 +1072,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1091,7 +1091,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1110,7 +1110,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1129,7 +1129,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Left Join @@ -1146,7 +1146,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -1164,7 +1164,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -1274,7 +1274,7 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -1289,7 +1289,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -1310,7 +1310,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -1331,7 +1331,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -1352,7 +1352,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1371,7 +1371,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------- Nested Loop Left Join @@ -1393,7 +1393,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (17 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------------- Merge Join @@ -1420,7 +1420,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (22 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------------- Merge Join @@ -1539,7 +1539,7 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -1554,7 +1554,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1573,7 +1573,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1592,7 +1592,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1611,7 +1611,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -1630,7 +1630,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Left Join @@ -1647,7 +1647,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -1665,7 +1665,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -1775,7 +1775,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -1790,7 +1790,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -1809,7 +1809,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -1828,7 +1828,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -1847,7 +1847,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -1866,7 +1866,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------- Hash Right Join @@ -1883,7 +1883,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------- Hash Join @@ -1901,7 +1901,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------- Hash Join @@ -2013,7 +2013,7 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -2028,7 +2028,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2047,7 +2047,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2066,7 +2066,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2085,7 +2085,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2104,7 +2104,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Right Join @@ -2121,7 +2121,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2139,7 +2139,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2220,7 +2220,7 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Right Join @@ -2237,7 +2237,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2255,7 +2255,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2303,7 +2303,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -2318,7 +2318,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2337,7 +2337,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2356,7 +2356,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2375,7 +2375,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2394,7 +2394,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Left Join @@ -2411,7 +2411,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2429,7 +2429,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2510,7 +2510,7 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Left Join @@ -2527,7 +2527,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2545,7 +2545,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -2593,7 +2593,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -2608,7 +2608,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -2629,7 +2629,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -2650,7 +2650,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------- Sort @@ -2671,7 +2671,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (15 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2690,7 +2690,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------- Nested Loop Left Join @@ -2712,7 +2712,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (17 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------------- Hash Join @@ -2736,7 +2736,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (19 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------------- Hash Join @@ -2823,7 +2823,7 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------- Nested Loop Left Join @@ -2845,7 +2845,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (17 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------------- Hash Join @@ -2869,7 +2869,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (19 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN ----------------------------------------------------------------------------------------- Hash Join @@ -2923,7 +2923,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -2938,7 +2938,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2957,7 +2957,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2976,7 +2976,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -2995,7 +2995,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- Sort @@ -3014,7 +3014,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Left Join @@ -3031,7 +3031,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -3049,7 +3049,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------- Merge Join @@ -3159,7 +3159,7 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; QUERY PLAN ----------------------------------------------------------- Nested Loop @@ -3174,7 +3174,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -3193,7 +3193,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -3212,7 +3212,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -3231,7 +3231,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; QUERY PLAN -------------------------------------------------------------------------- Sort @@ -3250,7 +3250,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ (13 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------- Hash Right Join @@ -3267,7 +3267,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; QUERY PLAN -------------------------------------------------------------------- Hash Join @@ -3285,7 +3285,7 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_ Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; QUERY PLAN -------------------------------------------------------------------- Hash Join diff --git a/src/test/regress/expected/col_subplan_base_1.out b/src/test/regress/expected/col_subplan_base_1.out index ceb5a4a90..99f5ba8cc 100644 --- a/src/test/regress/expected/col_subplan_base_1.out +++ b/src/test/regress/expected/col_subplan_base_1.out @@ -6,8 +6,8 @@ set current_schema = col_distribute_subplan_base; -- Create Table and Insert Data create table t_subplan1(a1 int, b1 int, c1 int, d1 int) with (orientation = column) ; create table t_subplan2(a2 int, b2 int, c2 int, d2 int) with (orientation = column) ; -insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6 from public.src; -insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9 from public.src; +insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6; +insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9; -- 1. initplan explain (costs off) select case when (select count(*) @@ -269,8 +269,8 @@ from t ctr2 where ctr1.d2 = ctr2.d2) order by 1 limit 10; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Limit CTE t -> Row Adapter @@ -283,14 +283,15 @@ limit 10; -> Sort Sort Key: ctr1.total -> Hash Join - Hash Cond: (ctr1.d2 = ctr2.d2) - Join Filter: ((ctr1.total)::numeric > ((avg(ctr2.total) * 1.2))) + Hash Cond: (ctr1.d2 = subquery."?column?") + Join Filter: ((ctr1.total)::numeric > (subquery."?column?" * 1.2)) -> CTE Scan on t ctr1 -> Hash - -> HashAggregate - Group By Key: ctr2.d2 - -> CTE Scan on t ctr2 -(19 rows) + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: ctr2.d2 + -> CTE Scan on t ctr2 +(20 rows) with t as (select d1 @@ -341,8 +342,8 @@ from t ctr3 where ctr2.d2=ctr3.d2)) order by 1 limit 10; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- Limit CTE t -> Row Adapter @@ -359,15 +360,16 @@ limit 10; SubPlan 2 -> Aggregate -> Nested Loop - Join Filter: (((ctr1.d2 + ctr2.d2))::numeric < ((avg(ctr3.total) * 3::numeric))) + Join Filter: (((ctr1.d2 + ctr2.d2))::numeric < (subquery."?column?" * 3::numeric)) -> CTE Scan on t ctr2 Filter: (d2 = ctr1.d2) -> Materialize - -> GroupAggregate - Group By Key: ctr3.d2 - -> CTE Scan on t ctr3 - Filter: (d2 = ctr1.d2) -(24 rows) + -> Subquery Scan on subquery + -> GroupAggregate + Group By Key: ctr3.d2 + -> CTE Scan on t ctr3 + Filter: (d2 = ctr1.d2) +(25 rows) with t as (select d1 @@ -610,15 +612,16 @@ select a1, count(*) cnt -> Vector Sonic Hash Join Hash Cond: (col_distribute_subplan_base.t_subplan1.a1 = t_subplan2.a2) -> Vector Sonic Hash Join - Hash Cond: (col_distribute_subplan_base.t_subplan1.c1 = t2.c2) - Join Filter: ((col_distribute_subplan_base.t_subplan1.b1)::numeric > (1.2 * (avg(t2.b2)))) + Hash Cond: (col_distribute_subplan_base.t_subplan1.c1 = subquery."?column?") + Join Filter: ((col_distribute_subplan_base.t_subplan1.b1)::numeric > (1.2 * subquery.avg)) -> CStore Scan on t_subplan1 - -> Vector Sonic Hash Aggregate - Group By Key: t2.c2 - -> CStore Scan on t_subplan2 t2 + -> Vector Subquery Scan on subquery + -> Vector Sonic Hash Aggregate + Group By Key: t2.c2 + -> CStore Scan on t_subplan2 t2 -> CStore Scan on t_subplan2 Filter: ((c2)::numeric > $0) -(22 rows) +(23 rows) select a1, count(*) cnt @@ -755,18 +758,19 @@ select a1, count(*) cnt -> CStore Scan on t_subplan2 Filter: ((c2)::numeric > $0) -> Vector Sonic Hash Join - Hash Cond: (col_distribute_subplan_base.t_subplan1.c1 = t2.c2) - Join Filter: ((col_distribute_subplan_base.t_subplan1.b1)::numeric > (1.2 * (avg(t2.b2)))) + Hash Cond: (col_distribute_subplan_base.t_subplan1.c1 = subquery."?column?") + Join Filter: ((col_distribute_subplan_base.t_subplan1.b1)::numeric > (1.2 * subquery.avg)) -> CStore Scan on t_subplan1 - -> Vector Sonic Hash Aggregate - Group By Key: t2.c2 - InitPlan 2 (returns $1) - -> Row Adapter - -> Vector Aggregate - -> CStore Scan on t_subplan1 (min-max optimization) - -> CStore Scan on t_subplan2 t2 - Filter: (d2 > $1) -(27 rows) + -> Vector Subquery Scan on subquery + -> Vector Sonic Hash Aggregate + Group By Key: t2.c2 + InitPlan 2 (returns $1) + -> Row Adapter + -> Vector Aggregate + -> CStore Scan on t_subplan1 (min-max optimization) + -> CStore Scan on t_subplan2 t2 + Filter: (d2 > $1) +(28 rows) select a1, count(*) cnt from t_subplan1 @@ -818,12 +822,13 @@ select a1, count(*) cnt -> Row Adapter -> Vector Aggregate -> Vector Sonic Hash Join - Hash Cond: (t1.d1 = t2.d2) - Join Filter: ((t1.a1)::numeric > (avg(t2.a2))) + Hash Cond: (t1.d1 = subquery."?column?") + Join Filter: ((t1.a1)::numeric > subquery.avg) -> CStore Scan on t_subplan1 t1 - -> Vector Sonic Hash Aggregate - Group By Key: t2.d2 - -> CStore Scan on t_subplan2 t2 + -> Vector Subquery Scan on subquery + -> Vector Sonic Hash Aggregate + Group By Key: t2.d2 + -> CStore Scan on t_subplan2 t2 -> Vector Sort Sort Key: t_subplan1.a1, (count(*)) -> Vector Sonic Hash Aggregate @@ -833,7 +838,7 @@ select a1, count(*) cnt -> CStore Scan on t_subplan1 -> CStore Scan on t_subplan2 Filter: ((c2)::numeric > $0) -(21 rows) +(22 rows) select a1, count(*) cnt from t_subplan1 diff --git a/src/test/regress/expected/col_subplan_base_2.out b/src/test/regress/expected/col_subplan_base_2.out index 6911e5a3b..475539885 100644 --- a/src/test/regress/expected/col_subplan_base_2.out +++ b/src/test/regress/expected/col_subplan_base_2.out @@ -6,8 +6,8 @@ set current_schema = col_distribute_subplan_base_2; -- Create Table and Insert Data create table t_subplan1(a1 int, b1 int, c1 int, d1 int) with (orientation = column) ; create table t_subplan2(a2 int, b2 int, c2 int, d2 int) with (orientation = column) ; -insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6 from public.src; -insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9 from public.src; +insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6; +insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9; create table t_subplan5 with (orientation = column) as select * from t_subplan1; create table t_subplan6 with (orientation = column) as select * from t_subplan2; --create row table @@ -87,7 +87,7 @@ group by c1, d1 order by c1+1 desc, 2 desc limit 5; Output: t_subplan1.c1, t_subplan1.d1, ((t_subplan1.c1 + 1)) -> Vector Limit Output: t_subplan1.c1, t_subplan1.d1, ((t_subplan1.c1 + 1)) - InitPlan 1 (returns $1) + InitPlan 1 (returns $2) -> Row Adapter Output: ('Dummy') -> Vector Partition Iterator @@ -105,7 +105,7 @@ group by c1, d1 order by c1+1 desc, 2 desc limit 5; Group By Key: t_subplan1.c1, t_subplan1.d1 -> Vector Result Output: t_subplan1.c1, t_subplan1.d1 - One-Time Filter: $1 + One-Time Filter: $2 -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 Output: t_subplan1.c1, t_subplan1.d1 (25 rows) @@ -129,8 +129,8 @@ select * from t_subplan2 where exists (select * from t_subplan1 where d1<9 and d1 >1 order by d1 limit 7) order by c1,b1 limit 10)) and exists( select max(a1),count(b1),c2 from t_subplan1 group by c2 having c2>2 or c2 is null) order by a2, b2, c2, d2 limit 10; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: t_subplan2.a2, t_subplan2.b2, t_subplan2.c2, t_subplan2.d2 -> Vector Limit @@ -143,29 +143,19 @@ order by a2, b2, c2, d2 limit 10; One-Time Filter: $1 InitPlan 2 (returns $1) -> Row Adapter - Output: col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1 - -> Vector Limit - Output: col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1 + Output: ('Dummy') + -> Vector Result + Output: ('Dummy') + One-Time Filter: $0 InitPlan 1 (returns $0) -> Row Adapter - Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1 - -> Vector Limit - Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1 - -> Vector Sort - Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1 - Sort Key: col_distribute_subplan_base_2.t_subplan1.d1 - -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1 - Filter: ((col_distribute_subplan_base_2.t_subplan1.d1 < 9) AND (col_distribute_subplan_base_2.t_subplan1.d1 > 1)) - -> Vector Sort - Output: col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1 - Sort Key: col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.b1 - -> Vector Result - Output: col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1 - One-Time Filter: $0 - -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1 - Filter: (col_distribute_subplan_base_2.t_subplan1.c1 < 20) + Output: ('Dummy') + -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 + Output: 'Dummy' + Filter: ((col_distribute_subplan_base_2.t_subplan1.d1 < 9) AND (col_distribute_subplan_base_2.t_subplan1.d1 > 1)) + -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 + Output: 'Dummy' + Filter: (col_distribute_subplan_base_2.t_subplan1.c1 < 20) -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 Output: 'Dummy' Filter: (col_distribute_subplan_base_2.t_subplan1.d1 < 8) @@ -189,7 +179,7 @@ order by a2, b2, c2, d2 limit 10; One-Time Filter: ((t_subplan2.c2 > 2) OR (t_subplan2.c2 IS NULL)) -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1 -(58 rows) +(48 rows) select * from t_subplan2 where exists (select d1 from t_subplan1 where d1<8 and @@ -969,21 +959,18 @@ select (with cte(foo) as (select a1) select foo from cte) from t_subplan1 order QUERY PLAN --------------------------------------------------------------------------- Row Adapter - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Limit - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Sort - Output: ((SubPlan 2)) - Sort Key: ((SubPlan 2)) + Output: ((SubPlan 1)) + Sort Key: ((SubPlan 1)) -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: (SubPlan 2) - SubPlan 2 - -> CTE Scan on cte - Output: cte.foo - CTE cte - -> Result - Output: t_subplan1.a1 -(15 rows) + Output: (SubPlan 1) + SubPlan 1 + -> Result + Output: t_subplan1.a1 +(12 rows) select (with cte(foo) as (select a1) select foo from cte) from t_subplan1 order by 1 limit 3; foo @@ -993,37 +980,6 @@ select (with cte(foo) as (select a1) select foo from cte) from t_subplan1 order 1 (3 rows) -explain (costs off, verbose on) -select (with cte(foo) as (select a1 from dual) select foo from cte) from t_subplan1 order by 1 limit 3; - QUERY PLAN ---------------------------------------------------------------------------- - Row Adapter - Output: ((SubPlan 2)) - -> Vector Limit - Output: ((SubPlan 2)) - -> Vector Sort - Output: ((SubPlan 2)) - Sort Key: ((SubPlan 2)) - -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: (SubPlan 2) - SubPlan 2 - -> CTE Scan on cte - Output: cte.foo - CTE cte - -> Subquery Scan on dual - Output: t_subplan1.a1 - -> Result - Output: 'X'::text -(17 rows) - -select (with cte(foo) as (select a1 from dual) select foo from cte) from t_subplan1 order by 1 limit 3; - foo ------ - 0 - 1 - 1 -(3 rows) - explain (costs off, verbose on) select (with cte(foo) as (values(b1)) values((select foo from cte))) from t_subplan1 order by 1 limit 3; QUERY PLAN @@ -1058,25 +1014,22 @@ select (with cte(foo) as (values(b1)) values((select foo from cte))) from t_subp explain (costs off, verbose on) select (with cte(foo) as (select avg(a1) from t_subplan1) select foo from cte) from t_subplan1 order by 1 limit 3; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------- Row Adapter - Output: ($1) + Output: ($0) -> Vector Limit - Output: ($1) - InitPlan 2 (returns $1) - -> CTE Scan on cte - Output: cte.foo - CTE cte - -> Row Adapter - Output: (avg(col_distribute_subplan_base_2.t_subplan1.a1)) - -> Vector Aggregate - Output: avg(col_distribute_subplan_base_2.t_subplan1.a1) - -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: col_distribute_subplan_base_2.t_subplan1.a1 + Output: ($0) + InitPlan 1 (returns $0) + -> Row Adapter + Output: (avg(col_distribute_subplan_base_2.t_subplan1.a1)) + -> Vector Aggregate + Output: avg(col_distribute_subplan_base_2.t_subplan1.a1) + -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 + Output: col_distribute_subplan_base_2.t_subplan1.a1 -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: $1 -(16 rows) + Output: $0 +(13 rows) select (with cte(foo) as (select avg(a1) from t_subplan1) select foo from cte) from t_subplan1 order by 1 limit 3; foo @@ -1088,28 +1041,25 @@ select (with cte(foo) as (select avg(a1) from t_subplan1) select foo from cte) f explain (costs off, verbose on) select (with cte(foo) as (select t_subplan1.b1 from t_subplan2 limit 1) select foo from cte) from t_subplan1 order by 1 limit 3; - QUERY PLAN -------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------- Row Adapter - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Limit - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Sort - Output: ((SubPlan 2)) - Sort Key: ((SubPlan 2)) + Output: ((SubPlan 1)) + Sort Key: ((SubPlan 1)) -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: (SubPlan 2) - SubPlan 2 - -> CTE Scan on cte - Output: cte.foo - CTE cte - -> Row Adapter - Output: (t_subplan1.b1) - -> Vector Limit - Output: (t_subplan1.b1) - -> CStore Scan on col_distribute_subplan_base_2.t_subplan2 - Output: t_subplan1.b1 -(19 rows) + Output: (SubPlan 1) + SubPlan 1 + -> Row Adapter + Output: ($0) + -> Vector Limit + Output: (t_subplan1.b1) + -> CStore Scan on col_distribute_subplan_base_2.t_subplan2 + Output: t_subplan1.b1 +(16 rows) select (with cte(foo) as (select t_subplan1.b1 from t_subplan2 limit 1) select foo from cte) from t_subplan1 order by 1 limit 3; foo @@ -1121,28 +1071,27 @@ select (with cte(foo) as (select t_subplan1.b1 from t_subplan2 limit 1) select f explain (costs off, verbose on) select (with cte(foo) as (select t_subplan1.b1 from t_subplan2 limit 1) select foo+t_subplan1.c1 from cte) from t_subplan1 order by 1 limit 3; - QUERY PLAN -------------------------------------------------------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------------------------------------------- Row Adapter - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Limit - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Sort - Output: ((SubPlan 2)) - Sort Key: ((SubPlan 2)) + Output: ((SubPlan 1)) + Sort Key: ((SubPlan 1)) -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: (SubPlan 2) - SubPlan 2 - -> CTE Scan on cte - Output: (cte.foo + t_subplan1.c1) - CTE cte - -> Row Adapter - Output: (t_subplan1.b1) - -> Vector Limit - Output: (t_subplan1.b1) - -> CStore Scan on col_distribute_subplan_base_2.t_subplan2 - Output: t_subplan1.b1 -(19 rows) + Output: (SubPlan 1) + SubPlan 1 + -> Row Adapter + Output: ((cte.foo + $0)) + -> Vector Subquery Scan on cte + Output: (cte.foo + t_subplan1.c1) + -> Vector Limit + Output: (t_subplan1.b1) + -> CStore Scan on col_distribute_subplan_base_2.t_subplan2 + Output: t_subplan1.b1 +(18 rows) select (with cte(foo) as (select t_subplan1.b1 from t_subplan2 limit 1) select foo+t_subplan1.c1 from cte) from t_subplan1 order by 1 limit 3; ?column? @@ -1193,21 +1142,18 @@ select (with cte(foo) as (values(b1)) select foo from cte) from t_subplan1 order QUERY PLAN --------------------------------------------------------------------------- Row Adapter - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Limit - Output: ((SubPlan 2)) + Output: ((SubPlan 1)) -> Vector Sort - Output: ((SubPlan 2)) - Sort Key: ((SubPlan 2)) + Output: ((SubPlan 1)) + Sort Key: ((SubPlan 1)) -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 - Output: (SubPlan 2) - SubPlan 2 - -> CTE Scan on cte - Output: cte.foo - CTE cte - -> Values Scan on "*VALUES*" - Output: "*VALUES*".column1 -(15 rows) + Output: (SubPlan 1) + SubPlan 1 + -> Values Scan on "*VALUES*" + Output: "*VALUES*".column1 +(12 rows) select (with cte(foo) as (values(b1)) select foo from cte) from t_subplan1 order by 1 limit 3; foo @@ -1352,8 +1298,8 @@ select * from t_subplan1 where c1 = (with tmp as (select d2 from t_subplan2 wher Sort Key: t_subplan1.a1, t_subplan1.b1, t_subplan1.c1, t_subplan1.d1 -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 Output: t_subplan1.a1, t_subplan1.b1, t_subplan1.c1, t_subplan1.d1 - Filter: (t_subplan1.c1 = (SubPlan 3)) - SubPlan 3 + Filter: (t_subplan1.c1 = (SubPlan 2)) + SubPlan 2 -> Aggregate Output: count(*) CTE tmp @@ -1364,16 +1310,22 @@ select * from t_subplan1 where c1 = (with tmp as (select d2 from t_subplan2 wher Filter: (t_subplan2.b2 = t_subplan1.a1) -> Aggregate Output: 'abc'::text, count(tmp1.d2) - -> CTE Scan on tmp tmp1 + -> Hash Left Join Output: tmp1.d2 - Filter: (tmp1.d2 > (SubPlan 2)) - SubPlan 2 - -> Aggregate - Output: count(*) - -> CTE Scan on tmp tmp2 - Output: tmp2.d2 - Filter: (tmp2.d2 = tmp1.d2) -(28 rows) + Hash Cond: (tmp1.d2 = subquery."?column?") + Filter: (tmp1.d2 > COALESCE(subquery.count, 0)) + -> CTE Scan on tmp tmp1 + Output: tmp1.d2 + -> Hash + Output: subquery."?column?", subquery.count + -> Subquery Scan on subquery + Output: subquery."?column?", subquery.count + -> HashAggregate + Output: count(*), tmp2.d2 + Group By Key: tmp2.d2 + -> CTE Scan on tmp tmp2 + Output: tmp2.d2 +(34 rows) select * from t_subplan1 where c1 = (with tmp as (select d2 from t_subplan2 where b2=a1) select count(*) from (select 'abc', count(d2) from tmp tmp1 @@ -1405,8 +1357,8 @@ select * from t_subplan1 where c1 = (with tmp as (select d2 from t_subplan2 wher Sort Key: t_subplan1.a1, t_subplan1.b1, t_subplan1.c1, t_subplan1.d1 -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 Output: t_subplan1.a1, t_subplan1.b1, t_subplan1.c1, t_subplan1.d1 - Filter: (t_subplan1.c1 = (SubPlan 3)) - SubPlan 3 + Filter: (t_subplan1.c1 = (SubPlan 2)) + SubPlan 2 -> Aggregate Output: count(*) CTE tmp @@ -1415,16 +1367,21 @@ select * from t_subplan1 where c1 = (with tmp as (select d2 from t_subplan2 wher -> CStore Scan on col_distribute_subplan_base_2.t_subplan2 Output: t_subplan2.d2 Filter: (t_subplan2.b2 = t_subplan1.a1) - -> CTE Scan on tmp tmp1 - Output: tmp1.d2 - Filter: (tmp1.d2 > (SubPlan 2)) - SubPlan 2 - -> Aggregate - Output: count(*) - -> CTE Scan on tmp tmp2 - Output: tmp2.d2 - Filter: (tmp2.d2 = tmp1.d2) -(26 rows) + -> Hash Left Join + Hash Cond: (tmp1.d2 = subquery."?column?") + Filter: (tmp1.d2 > COALESCE(subquery.count, 0)) + -> CTE Scan on tmp tmp1 + Output: tmp1.d2 + -> Hash + Output: subquery."?column?", subquery.count + -> Subquery Scan on subquery + Output: subquery."?column?", subquery.count + -> HashAggregate + Output: count(*), tmp2.d2 + Group By Key: tmp2.d2 + -> CTE Scan on tmp tmp2 + Output: tmp2.d2 +(31 rows) select * from t_subplan1 where c1 = (with tmp as (select d2 from t_subplan2 where b2=a1) select count(*) from (select 'abc', d2 from tmp tmp1 @@ -1467,7 +1424,7 @@ inner join t_subplan1 t3 on t3.a1=t_subplan1.c1 where t3.a1=0 order by 1,2,3,4 l Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1, t_subplan2.a2, t_subplan2.b2, ($0), t3.a1, t3.b1, t3.c1, t3.d1 -> Vector Nest Loop Left Join Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1, t_subplan2.a2, t_subplan2.b2, ($0) - Join Filter: (NULL::boolean AND (t_subplan2.b2 = col_distribute_subplan_base_2.t_subplan1.b1)) + Join Filter: false -> CStore Scan on col_distribute_subplan_base_2.t_subplan1 Output: col_distribute_subplan_base_2.t_subplan1.a1, col_distribute_subplan_base_2.t_subplan1.b1, col_distribute_subplan_base_2.t_subplan1.c1, col_distribute_subplan_base_2.t_subplan1.d1 Filter: (col_distribute_subplan_base_2.t_subplan1.c1 = 0) diff --git a/src/test/regress/expected/collate.out b/src/test/regress/expected/collate.out index 80f505e28..bf833f893 100644 --- a/src/test/regress/expected/collate.out +++ b/src/test/regress/expected/collate.out @@ -606,9 +606,9 @@ explain (verbose, costs off) SELECT collation for ((SELECT b FROM collate_test1 Output: pg_collation_for($0) InitPlan 1 (returns $0) -> Limit - Output: b + Output: collate_test1.b -> Seq Scan on collate_tests.collate_test1 - Output: b + Output: collate_test1.b (7 rows) -- diff --git a/src/test/regress/expected/combocid.out b/src/test/regress/expected/combocid.out index b81068565..d3254fbfc 100644 --- a/src/test/regress/expected/combocid.out +++ b/src/test/regress/expected/combocid.out @@ -2,7 +2,7 @@ -- Tests for some likely failure cases with combo cmin/cmax mechanism -- -- Enforce use of COMMIT instead of 2PC for temporary objects -CREATE TEMP TABLE combocidtest (foobar int) distribute by replication; +CREATE TEMP TABLE combocidtest (foobar int); START TRANSACTION; -- a few dummy ops to push up the CommandId counter INSERT INTO combocidtest SELECT 1 LIMIT 0; @@ -60,8 +60,8 @@ DELETE FROM combocidtest; FETCH ALL FROM c; ctid | cmin | foobar -------+------+-------- - (0,1) | 2 | 1 - (0,2) | 2 | 2 + (0,1) | 1 | 1 + (0,2) | 1 | 2 (0,5) | 0 | 333 (3 rows) @@ -69,8 +69,8 @@ ROLLBACK; SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; ctid | cmin | foobar -------+------+-------- - (0,1) | 2 | 1 - (0,2) | 2 | 2 + (0,1) | 1 | 1 + (0,2) | 1 | 2 (2 rows) -- check behavior with locked tuples @@ -90,8 +90,8 @@ INSERT INTO combocidtest VALUES (444); SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; ctid | cmin | foobar -------+------+-------- - (0,1) | 2 | 1 - (0,2) | 2 | 2 + (0,1) | 1 | 1 + (0,2) | 1 | 2 (0,6) | 10 | 444 (3 rows) @@ -100,16 +100,16 @@ SAVEPOINT s1; SELECT ctid,cmin,* FROM combocidtest FOR UPDATE; ctid | cmin | foobar -------+------+-------- - (0,1) | 2 | 1 - (0,2) | 2 | 2 + (0,1) | 1 | 1 + (0,2) | 1 | 2 (0,6) | 10 | 444 (3 rows) SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; ctid | cmin | foobar -------+------+-------- - (0,1) | 2 | 1 - (0,2) | 2 | 2 + (0,1) | 1 | 1 + (0,2) | 1 | 2 (0,6) | 10 | 444 (3 rows) @@ -118,17 +118,17 @@ UPDATE combocidtest SET foobar = foobar + 10; SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; ctid | cmin | foobar -------+------+-------- - (0,7) | 11 | 11 - (0,8) | 11 | 12 - (0,9) | 11 | 454 + (0,7) | 12 | 11 + (0,8) | 12 | 12 + (0,9) | 12 | 454 (3 rows) ROLLBACK TO s1; SELECT ctid,cmin,* FROM combocidtest ORDER BY ctid; ctid | cmin | foobar -------+------+-------- - (0,1) | 11 | 1 - (0,2) | 11 | 2 + (0,1) | 12 | 1 + (0,2) | 12 | 2 (0,6) | 0 | 444 (3 rows) diff --git a/src/test/regress/expected/create_index_gist.out b/src/test/regress/expected/create_index_gist.out index df9a12305..586e1cb33 100644 --- a/src/test/regress/expected/create_index_gist.out +++ b/src/test/regress/expected/create_index_gist.out @@ -2,67 +2,47 @@ -- GiST (rtree-equivalent opclasses only) -- CREATE INDEX grect2ind ON fast_emp4000 USING gist (home_base); - CREATE INDEX gpolygonind ON polygon_tbl USING gist (f1); - CREATE INDEX gcircleind ON circle_tbl USING gist (f1); - INSERT INTO POINT_TBL(f1) VALUES (NULL); - CREATE INDEX gpointind ON point_tbl USING gist (f1); - - --CREATE TABLE gpolygon_tbl AS -- SELECT polygon(home_base) AS f1 FROM slow_emp4000; --INSERT INTO gpolygon_tbl VALUES ( '(1000,0,0,1000)' ); --INSERT INTO gpolygon_tbl VALUES ( '(0,1000,1000,1000)' ); - --CREATE TABLE gcircle_tbl AS -- SELECT circle(home_base) AS f1 FROM slow_emp4000; - --CREATE INDEX ggpolygonind ON gpolygon_tbl USING gist (f1); - --CREATE INDEX ggcircleind ON gcircle_tbl USING gist (f1); - - -- -- Test GiST indexes -- - -- get non-indexed results for comparison purposes - SET enable_seqscan = ON; SET enable_indexscan = OFF; SET enable_bitmapscan = OFF; - SELECT * FROM fast_emp4000 WHERE home_base @ '(200,200),(2000,1000)'::box ORDER BY (home_base[0])[0]; - home_base ------------------------ - (337,455),(240,359) - (1444,403),(1346,344) -(2 rows) - + home_base +----------- +(0 rows) SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box; count ------- - 2 + 0 (1 row) - SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL; count ------- - 278 + 0 (1 row) - SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon ORDER BY (poly_center(f1))[0]; ERROR: type "line" not yet implemented - SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) ORDER BY area(f1); f1 @@ -73,74 +53,62 @@ SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) <(100,1),115> (4 rows) - --SELECT count(*) FROM gpolygon_tbl WHERE f1 && '(1000,1000,0,0)'::polygon; - --SELECT count(*) FROM gcircle_tbl WHERE f1 && '<(500,500),500>'::circle; - SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)'; count ------- 3 (1 row) - SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1; count ------- 3 (1 row) - SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)'; count ------- 3 (1 row) - SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>'; count ------- 1 (1 row) - SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; count ------- 3 (1 row) - SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; count ------- 2 (1 row) - SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; count ------- 1 (1 row) - SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; count ------- 3 (1 row) - SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; count ------- 1 (1 row) - SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; f1 ------------ @@ -153,14 +121,12 @@ SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; (7 rows) - SELECT * FROM point_tbl WHERE f1 IS NULL; f1 ---- (1 row) - SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; f1 ------------ @@ -172,7 +138,6 @@ SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; (5.1,34.5) (6 rows) - SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; f1 --------- @@ -182,88 +147,83 @@ SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0 (10,10) (4 rows) - -- Now check the results from plain indexscan SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_bitmapscan = OFF; - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM fast_emp4000 WHERE home_base @ '(200,200),(2000,1000)'::box ORDER BY (home_base[0])[0]; + QUERY PLAN +---------------------------------------------------------------- + Sort + Sort Key: ((home_base[0])[0]) + -> Index Scan using grect2ind on fast_emp4000 + Index Cond: (home_base @ '(2000,1000),(200,200)'::box) +(4 rows) + +SELECT * FROM fast_emp4000 + WHERE home_base @ '(200,200),(2000,1000)'::box + ORDER BY (home_base[0])[0]; + home_base +----------- +(0 rows) + +EXPLAIN(COSTS OFF) +SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box; QUERY PLAN ------------------------------------------------------------- - Sort - Sort Key: ((fast_emp4000.home_base[0])[0]) - -> Data Node Scan on fast_emp4000 "_REMOTE_TABLE_QUERY_" + Aggregate + -> Index Scan using grect2ind on fast_emp4000 + Index Cond: (home_base && '(1000,1000),(0,0)'::box) (3 rows) -SELECT * FROM fast_emp4000 - WHERE home_base @ '(200,200),(2000,1000)'::box - ORDER BY (home_base[0])[0]; - home_base ------------------------ - (337,455),(240,359) - (1444,403),(1346,344) -(2 rows) - - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) -SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box; - QUERY PLAN --------------------------------------------------- - Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) - SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box; count ------- - 2 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL; QUERY PLAN -------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Index Scan using grect2ind on fast_emp4000 + Index Cond: (home_base IS NULL) +(3 rows) SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL; count ------- - 278 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon ORDER BY (poly_center(f1))[0]; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - -> Sort - Sort Key: ((poly_center(f1))[0]) - -> Index Scan using gpolygonind on polygon_tbl - Index Cond: (f1 ~ '((1,1),(2,2),(2,1))'::polygon) -(5 rows) + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: ((poly_center(f1))[0]) + -> Index Scan using gpolygonind on polygon_tbl + Index Cond: (f1 ~ '((1,1),(2,2),(2,1))'::polygon) +(4 rows) SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon ORDER BY (poly_center(f1))[0]; ERROR: type "line" not yet implemented - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) ORDER BY area(f1); - QUERY PLAN -------------------------------------------------- + QUERY PLAN +-------------------------------------------------- Sort - Sort Key: (area(circle_tbl.f1)) - -> Data Node Scan on "__REMOTE_SORT_QUERY__" -(3 rows) + Sort Key: (area(f1)) + -> Index Scan using gcircleind on circle_tbl + Index Cond: (f1 && '<(1,-2),1>'::circle) +(4 rows) SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) ORDER BY area(f1); @@ -275,21 +235,20 @@ SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) <(100,1),115> (4 rows) - ---EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +--EXPLAIN(COSTS OFF) --SELECT count(*) FROM gpolygon_tbl WHERE f1 && '(1000,1000,0,0)'::polygon; --SELECT count(*) FROM gpolygon_tbl WHERE f1 && '(1000,1000,0,0)'::polygon; - ---EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +--EXPLAIN(COSTS OFF) --SELECT count(*) FROM gcircle_tbl WHERE f1 && '<(500,500),500>'::circle; --SELECT count(*) FROM gcircle_tbl WHERE f1 && '<(500,500),500>'::circle; - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +---------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl + Index Cond: (f1 <@ '(100,100),(0,0)'::box) +(3 rows) SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)'; count @@ -297,13 +256,14 @@ SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)'; 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +---------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl + Index Cond: ('(100,100),(0,0)'::box @> f1) +(3 rows) SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1; count @@ -311,13 +271,14 @@ SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1; 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +---------------------------------------------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl + Index Cond: (f1 <@ '((0,0),(0,100),(100,100),(50,50),(100,0),(0,0))'::polygon) +(3 rows) SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)'; count @@ -325,13 +286,14 @@ SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50, 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +---------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl + Index Cond: (f1 <@ '<(50,50),50>'::circle) +(3 rows) SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>'; count @@ -339,13 +301,14 @@ SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl p + Index Cond: (f1 << '(0,0)'::point) +(3 rows) SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; count @@ -353,13 +316,14 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl p + Index Cond: (f1 >> '(0,0)'::point) +(3 rows) SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; count @@ -367,13 +331,14 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; 2 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl p + Index Cond: (f1 <^ '(0,0)'::point) +(3 rows) SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; count @@ -381,13 +346,14 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl p + Index Cond: (f1 >^ '(0,0)'::point) +(3 rows) SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; count @@ -395,13 +361,14 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Index Scan using gpointind on point_tbl p + Index Cond: (f1 ~= '(-5,-12)'::point) +(3 rows) SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; count @@ -409,13 +376,13 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +----------------------------------------- + Index Scan using gpointind on point_tbl + Order By: (f1 <-> '(0,1)'::point) +(2 rows) SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; f1 @@ -429,13 +396,13 @@ SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; (7 rows) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 IS NULL; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +----------------------------------------- + Index Scan using gpointind on point_tbl + Index Cond: (f1 IS NULL) +(2 rows) SELECT * FROM point_tbl WHERE f1 IS NULL; f1 @@ -443,13 +410,14 @@ SELECT * FROM point_tbl WHERE f1 IS NULL; (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +----------------------------------------- + Index Scan using gpointind on point_tbl + Index Cond: (f1 IS NOT NULL) + Order By: (f1 <-> '(0,1)'::point) +(3 rows) SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; f1 @@ -462,13 +430,14 @@ SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; (5.1,34.5) (6 rows) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------ + Index Scan using gpointind on point_tbl + Index Cond: (f1 <@ '(10,10),(-10,-10)'::box) + Order By: (f1 <-> '(0,1)'::point) +(3 rows) SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; f1 @@ -479,18 +448,21 @@ SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0 (10,10) (4 rows) - -- Now check the results from bitmap indexscan SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_bitmapscan = ON; - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------------------ + Sort + Sort Key: ((f1 <-> '(0,1)'::point)) + -> Bitmap Heap Scan on point_tbl + Recheck Cond: (f1 <@ '(10,10),(-10,-10)'::box) + -> Bitmap Index Scan on gpointind + Index Cond: (f1 <@ '(10,10),(-10,-10)'::box) +(6 rows) SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; f1 @@ -505,7 +477,6 @@ SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0 create table t(id int, c_point point); insert into t select id, point'(1, 2)' from (select * from generate_series(1, 200000) as id) as x; create index i on t using gist(c_point) with (buffering=on); - RESET enable_seqscan; RESET enable_indexscan; RESET enable_bitmapscan; diff --git a/src/test/regress/expected/create_index_spgist.out b/src/test/regress/expected/create_index_spgist.out index f0f38e443..77997063a 100644 --- a/src/test/regress/expected/create_index_spgist.out +++ b/src/test/regress/expected/create_index_spgist.out @@ -1,218 +1,181 @@ -- -- SP-GiST -- - CREATE TABLE quad_point_tbl AS SELECT point(unique1,unique2) AS p FROM tenk1; - INSERT INTO quad_point_tbl SELECT '(333.0,400.0)'::point FROM generate_series(1,1000); - INSERT INTO quad_point_tbl VALUES (NULL), (NULL), (NULL); - CREATE INDEX sp_quad_ind ON quad_point_tbl USING spgist (p); ERROR: access method "spgist" does not support row store - CREATE TABLE kd_point_tbl AS SELECT * FROM quad_point_tbl; - CREATE INDEX sp_kd_ind ON kd_point_tbl USING spgist (p kd_point_ops); ERROR: access method "spgist" does not support row store - CREATE TABLE suffix_text_tbl AS SELECT name AS t FROM road WHERE name !~ '^[0-9]'; - INSERT INTO suffix_text_tbl SELECT 'P0123456789abcdef' FROM generate_series(1,1000); INSERT INTO suffix_text_tbl VALUES ('P0123456789abcde'); INSERT INTO suffix_text_tbl VALUES ('P0123456789abcdefF'); - CREATE INDEX sp_suff_ind ON suffix_text_tbl USING spgist (t); ERROR: access method "spgist" does not support row store - - -- -- Test SP-GiST indexes -- - -- get non-indexed results for comparison purposes - SET enable_seqscan = ON; SET enable_indexscan = OFF; SET enable_bitmapscan = OFF; - SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; count ------- 3 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; count ------- - 11000 + 1000 (1 row) - SELECT count(*) FROM quad_point_tbl; count ------- - 11003 + 1003 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; count ------- - 1057 + 1000 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; count ------- - 1057 + 1000 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; count ------- - 6000 + 1000 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; count ------- - 4999 + 0 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; count ------- - 5000 + 1000 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; count ------- - 5999 + 0 (1 row) - SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; count ------- - 1 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; count ------- 1000 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; count ------- 1 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; count ------- 1 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; count ------- - 272 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; count ------- - 272 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; count ------- - 273 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; count ------- - 273 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; count ------- - 1 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; count ------- - 2 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; count ------- - 50 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; count ------- - 50 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; count ------- - 48 + 0 (1 row) - SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; count ------- - 48 + 0 (1 row) - -- Now check the results from plain indexscan SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_bitmapscan = OFF; - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +---------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p IS NULL) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; count @@ -220,253 +183,253 @@ SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +---------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p IS NOT NULL) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; count ------- - 11000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +---------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" + -> Seq Scan on quad_point_tbl (2 rows) SELECT count(*) FROM quad_point_tbl; count ------- - 11003 + 1003 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p <@ '(1000,1000),(200,200)'::box) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: ('(1000,1000),(200,200)'::box @> p) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p << '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; count ------- - 6000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p >> '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; count ------- - 4999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p <^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; count ------- - 5000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p >^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; count ------- - 5999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +-------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p ~= '(4585,365)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; count ------- - 1 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p <@ '(1000,1000),(200,200)'::box) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: ('(1000,1000),(200,200)'::box @> p) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p << '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; count ------- - 6000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p >> '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; count ------- - 4999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p <^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; count ------- - 5000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p >^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; count ------- - 5999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +-------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p ~= '(4585,365)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; count ------- - 1 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'P0123456789abcdef'::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; count @@ -474,13 +437,14 @@ SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------ + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'P0123456789abcde'::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; count @@ -488,13 +452,14 @@ SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +-------------------------------------------------- + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'P0123456789abcdefF'::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; count @@ -502,191 +467,168 @@ SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t < 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t < 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; count ------- - 272 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~<~ 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~<~ 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; count ------- - 272 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t <= 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t <= 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; count ------- - 273 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~<=~ 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~<=~ 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; count ------- - 273 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------------------------ + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; count ------- - 1 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------------------------ + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; count ------- - 2 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t >= 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t >= 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; count ------- - 50 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~>=~ 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~>=~ 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; count ------- - 50 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t > 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t > 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; count ------- - 48 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~>~ 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~>~ 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; count ------- - 48 + 0 (1 row) - -- Now check the results from bitmap indexscan SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_bitmapscan = ON; - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +---------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p IS NULL) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; count @@ -694,253 +636,253 @@ SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; 3 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +---------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p IS NOT NULL) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; count ------- - 11000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +---------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" + -> Seq Scan on quad_point_tbl (2 rows) SELECT count(*) FROM quad_point_tbl; count ------- - 11003 + 1003 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p <@ '(1000,1000),(200,200)'::box) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: ('(1000,1000),(200,200)'::box @> p) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p << '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; count ------- - 6000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p >> '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; count ------- - 4999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p <^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; count ------- - 5000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p >^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; count ------- - 5999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +-------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on quad_point_tbl + Filter: (p ~= '(4585,365)'::point) +(3 rows) SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; count ------- - 1 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p <@ '(1000,1000),(200,200)'::box) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +----------------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: ('(1000,1000),(200,200)'::box @> p) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; count ------- - 1057 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p << '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; count ------- - 6000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p >> '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; count ------- - 4999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p <^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; count ------- - 5000 + 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +--------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p >^ '(5000,4000)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; count ------- - 5999 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; - QUERY PLAN --------------------------------------------------- + QUERY PLAN +-------------------------------------------- Aggregate - -> Data Node Scan on "__REMOTE_GROUP_QUERY__" -(2 rows) + -> Seq Scan on kd_point_tbl + Filter: (p ~= '(4585,365)'::point) +(3 rows) SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; count ------- - 1 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------- + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'P0123456789abcdef'::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; count @@ -948,13 +890,14 @@ SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; 1000 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------ + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'P0123456789abcde'::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; count @@ -962,13 +905,14 @@ SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +-------------------------------------------------- + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'P0123456789abcdefF'::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; count @@ -976,179 +920,156 @@ SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; 1 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t < 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t < 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; count ------- - 272 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~<~ 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~<~ 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; count ------- - 272 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t <= 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t <= 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; count ------- - 273 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~<=~ 'Aztec Ct '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~<=~ 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; count ------- - 273 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------------------------ + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'Aztec Ct '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; count ------- - 1 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; - QUERY PLAN ----------------- - Data Node Scan -(1 row) + QUERY PLAN +------------------------------------------------------------------ + Aggregate + -> Seq Scan on suffix_text_tbl + Filter: (t = 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; count ------- - 2 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t >= 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t >= 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; count ------- - 50 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; - QUERY PLAN ---------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~>=~ 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~>=~ 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; count ------- - 50 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; - QUERY PLAN ------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------ Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t > 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t > 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; count ------- - 48 + 0 (1 row) - -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; - QUERY PLAN --------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Seq Scan on suffix_text_tbl - Filter: (t ~>~ 'Worth St '::text) -(5 rows) + -> Seq Scan on suffix_text_tbl + Filter: (t ~>~ 'Worth St '::text) +(3 rows) SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; count ------- - 48 + 0 (1 row) - RESET enable_seqscan; RESET enable_indexscan; RESET enable_bitmapscan; diff --git a/src/test/regress/expected/decode_partititon.out b/src/test/regress/expected/decode_partititon.out index 3839f171b..da233099f 100644 --- a/src/test/regress/expected/decode_partititon.out +++ b/src/test/regress/expected/decode_partititon.out @@ -1,4 +1,4 @@ -execute direct on (datanode1)'SELECT ''init'' FROM pg_create_logical_replication_slot(''regression_slot'', ''test_decoding'');'; +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding'); ?column? ---------- init @@ -28,8 +28,7 @@ CREATE TABLE tm_t_jhseatmain ( seattype character varying(2), isdefault character varying(2) ) -WITH (orientation=row, compression=no) -DISTRIBUTE BY HASH (seatid); +WITH (orientation=row, compression=no); alter table tm_t_jhseatmain REPLICA IDENTITY FULL; CREATE INDEX tm_t_jhseatmain_seatid_idx ON tm_t_jhseatmain USING btree (seatid) TABLESPACE pg_default; -- @@ -84,7 +83,6 @@ CREATE TABLE tm_t_jhseattrack ( tasktargetid character varying(8000) ) WITH (orientation=row, compression=no) -DISTRIBUTE BY HASH (calltrackid) PARTITION BY RANGE (inserttimeforhis) ( PARTITION p_000 VALUES LESS THAN ('2018-05-01 00:00:00') TABLESPACE pg_default, @@ -127,7 +125,11 @@ insert into tm_t_jhseattrack (calltrackid, comid,inserttimeforhis,tasktargetid) insert into tm_t_jhseattrack (calltrackid, comid,inserttimeforhis,tasktargetid) values ('8', '123', '2018-08-08 11:11:11','QiETSk22V60KXd5uR3eJWb1L4RVEkCe0eIdrmzj7v9bMG66nuFWgGOl4Z629y6t79wolpxNL0inwJOd3j0Dj8OdrezrCwe3vBhak8hVYqDOZhSSUcl3atArxZctPhnEcuFmXMCL25qlGCxUEcN8vHTS0WGGxTa3H9fugb6CAQO6ibQMeXe3YXgPJMPAZjtwNzlT4LlvrtV3Z69xTdqc00l4C0uVDOMgHXtBy9qjscGh8F8lcpn2fyqcSLXmp3WqQKRIJClvERDCQ5NmkvJUTZq6AHMjB2zLCLObdZxHbuDlpKy457ijW2JRzl0udqAGveby325ym2K6CCu23CFPYe0npRcsBCsWGuk3mJs3BwtxYNpRJU0xsReHygutcgfcAT6hsoEneXK24uJDI301K42CFmVHt0enJaYvSWIWdjO77RAFKUwPjphO53PSnT6rnoM5blleYtcVE6UfRLUuuvCpSh86vyncMtCh8NmW7SbBiqaZ1oNlef4WRwScUzI1Ta8Rik8fwDaFTFYenCprHOeSaqoVQXM3XeK5TcEfG9eTE3YlZHDwlbJmrXB7KHu2L5XuBW47V8RT1FyQc1HS2g4O3ZfEwAw7ZNWqzQoOOz1GyqQ4LRM8XaMlZljlLFNAMzRGfzOnYGnQq4KvLnt3nzedLnSmmvhYoYYtRDb9DoPnipIo62hkVlRw2zJepQwD8lrjisMfarWjau1BQ8fCNWsFPvJyFz27KNgmzSVzDHc8w3zG1EC8qVDzgGYM6kJGrknQwCf0aMY0Fnw1RtZBetuOZiUVWYWd8DTu5tOz5CT4jKV03LVBygfRS0D9iTcgmq4LdJFCbowPYiFRnViLvSsdcpGk8JUOtOUwnpsTDOyWWxDDMge7Y1F0gbEJeoRx2BnKkFXikP4Acx4PDCgVXLfyNJ7lriJkeqooWbwAkqumiSvflC1CHA0Oar0rA358jNmzidZsXk95wYbHUwEsqu6UMqGGjBEtJkSRncEbQDAcr5ecVIYc2oW8Fs8Oo6BXhO8YQ6twzUylP6RBEFD1TTZScsxUosHv69kM6DCZRvaxrRYqQVhAEAiaS9UBWVWSVAZlyVEfgF62QoixDTr8j38wxnXN8dvn8Oyw435E2wwcK8zIRkGvI8l5l8cOFx1DGUtANpy9fVbjn5R5JRUhk5GZxID2Av0Afjum2Sl7DQLlLsgPauWkTX9Kv7CpsWP169HsmSqj2vu8N4NhozV7mpbcm8r8UBZk4wDgInqAIe2l9FtnzePftQh9O373YqdmgGtOTdJrhB7KBUs0Y75MhHfq4djmtQyAnlIAoLS0HPA8zSYRjnXVoxFiAiYnYnhbykChVO7sX1UQec1RqjC8G7L6JzNyMp3FzZMkDd7U4lACosk85g6BeH1NBEFHTzcioOXmlo6KzxchjQfeXG91d088Y8GIxIkfRBVwjS6JJ9QmPqUCWTXtdqs1Ss3f0IOb9AyjMumlXw17ML32Ylm15ESNWMSgO0MNUEqws6HKtyHzD4srfEiaCvNSBZsfkym42DrPzspmlqMOkyAUwIosx2aYlW3vlgUHdbm6X5j8lph0NHKDJYV7kVVwbjlQT5oWA4mo0vmbeXvlu5O4oz1yOgoQpAwCZeSq958tUOYZCkaWfPQtIbmniAx1unukWG4VB2ImGwbCGFpMkzzT5fAdGryuEm8qT2Fkod0pAvRA1AGFuASpFisF3k0yxsigPiU3PfMJAYaVoGrI6DX6MJBFoVxLealTM5grETvzbZkpv5sWzJSFNNE1zw670hkCGqnbDIAE1eonEaD3dP2kW0blm7MGIW8fHQgaSa9KeRrIlU5o3rzPi4vYw7Z4or9V7JpQJSUizbkKpKti1mrDgMWCeL1Ww0Hu4qED9of2pq7E0qglC1jc8zFGEws0QtkKJOIcwN5Lx2JRijxebGgDzf935rnMK2QNaSQxwL8T7c5fPsNQsTjRtMeo3ru7jbLkTrHJw9XtFS2lEFvWSFDbLHqFsKCCfHgtsh2OgjBMvXXZsiLFhIGTJqS2vOY4m4n8FKhLnIRJw8yiLaNmIOzi4hETqsOCQvAlzHqNK8mAAKIbeQShuhpSTn69Fe5PzZ0Z1KC5civDSx8rdQy1Yhebuaatez87SsWJ2SE50t2dR0uoHSgZZk0NOu6mT4j5QAFciD7DXta8kumRGsGZ60CKkyWxWAs60r88pA5GT5E3TQKpDKe34a8eyo5OOSKE9J7S9womsSgb3kVwptpjuRSS6h1KZBJtEGb72qkO8qQ145RjoBtIiFVeMMjCHSpcoq9KGNp93zuYuGBIBoLJTwiwCrs99HFRX9VYMara3fYnLTqc81gRRodj9vMCwiNkhyCn3TnWsFE4poAnJGyqU63nV9PihsWSloAeBN0TjYh2GIJfe7Zt3SGPSQXtCdGNr6RmdczQuHI1fL6NJWA687Lkh28J58nQ44wBAWiVtkM2WI9ZYAVX11B8nzbjxotVNQnHCZsp94Lp7eeVE0cZl8XyxtbpbZEOFlmBa8kE3VTuZYJYiMNXK5lBoRkpGPybue6vcgZzvITk0tCCzgpDbBypMJ8iSwNGAJ1DPkwaTgOd3hGsnVpSQNBsQz42WHzQgqNp5apOgyl9FRVm7a4NhvAYoukE2JlCuYSpYBxyZc1YUMERg2YSRoG6JkA5oLxc4JVmbiLuk6jydhJjay1Rg1NjGIeUN6WHFHoGjZvXV8QYfpCfhXrojy1P6AzewPfvQtwZiRgyPWQUcMujAL1JDTS4jL89qdu6xQp91Z1GMIVOOJreONhhwtbF4DEOHsK4Dtxujp1Vrg35POatrL4h5AMt3K8AxcY0wmk9BFomLLhUpLHbnCiMwp5pt3QQ68aWklVfkDrWezaXEcYlEBXuQnJDKpkaSkq2ZbCa8TqcMU0hWisUdKenrOR1xvwf9MCti4tghdjUXDvKfhujR30CHHuywkEwW6P40CFBFOlsLawkilXteOWLPK9cU7yGxH5n9AP8IuqNvhr7sfUwnGB2K44uwWvTtUBWOKUm4FtTMKkyP5o25jVGHju36jNT3eGHiUncpGqvh4nWZBjVKyVibfFBpilMQlOYz1vjyfE99mpZNyeSqZusyZTh8yoiJ279TsiL1gK0s0jASni9G6VzV8GnxUwAgt30fb5AMGqy0AschAbOwqHMpdZgslGy8ASH5O7bOoA8iSapNG3DWAfF85LUKiMJcvK7DI9Lq3dyfdNSJbQ05pZ3k5hpHUYJJ2acA9hkwkICRmOVRufMK4GoZNDw1VzAOA6I3dTqRVmzB0OiPTVTNVB72zXUknksNhvGOeqwZCprX336gOjTzKkW98GOlkAsVVYAtJqNF9ys2rSC61lZ60f5YfdDqEVbTd5dMlkikI4GZh8pCOJyEOYWU1TEZE9db5gOKqqVsOVhVo1ow4g0c4gqqZUfXUiYjS6TCm8UvUwKCRYYLzihtoyJHijuwVM9EJTAVRlK5bl1S9PXyX4mFsVG5yuVk7ViG8IVjTwfoH6Aagn33Mf3yuzXnUJxlYFRqd6zrsEFt5AubNRyTqriel5r58iKqNrGln66a45tZvhu9sTmIEuhPUyeSbO9iz9th5ThuP4jaG8DYRQ1la8vUwz71IAa7zteZdlNSKWmgoQ450VLuTAJKZGBxABZtp3MWJp8jGkpUuNkk3p9gPIk8Ig08HPVqIychNEUjPD4DheiaXhKCjVAR1qj25yj8WPJAkudtX7qyFy2s9DoiSjtJz6BZverho0b2OfP6G5uGYnsXkHA2Qn5Jk029zjKNEM9ilield3RvKaNUbdgRqbU4vN3UWE1UK03V8B6Guivyi8MjFSuWnekdleXCcPmg9J1CbrCZ3XobquOVHCbobmrmUfOqovwn4RjzCLTw3B1jVG4sCAHDMYk0xsgLN6tcNC5feOB7ftgvtENp4OTa73uuP4At0TZDlUdTz8Q8VqXIpBYNJHiG4Cvd1VwREPPjAm3tkdV6YJ8dEWkd'); insert into tm_t_jhseattrack (calltrackid, comid,inserttimeforhis,tasktargetid) values ('8', '123', '2018-08-08 11:11:11', 'QwunUKTiEYHn6LzPD8nZ0TKf0goiiSnYebbsLoAJHBWDGQMaiut8H3Hx9WGhEnAco5YtkS3RkjOktVkCf74M06DZS9BQQvm4qaoASLLwoqHIblEKNyQDYjXGjSQtdwot06odHZzVJAXegrOTkuQ88D9hlP4SGicweqzfJt1jniRXA0GKkRIiOHT0ROIRqedvYD4yqpbDymrYcr2n84ZN6d7Nl9uBI1qwuloeApIY6Zg8K8ld3FkZIh6nKUOiL59AKnEa7Gt3Z31A2HDpGNIIo8VsSz5XYyRyLQ3cmmzcfV6Bs3ksaS0SkLa2azkZXvR3bK5SqZo0KkVwH6OHiEptfTPJjt2APKtkOT25IKpMoa8V6gsJKb2jpbm2vfsEjgOrtbm1LB7065fwFy5f3rSit4aiDXMgxUyQVKb1G8l6xqs2ioBc9jOsHj4FAGLXV9DaeE1eCcattslBag7aTMWqpRpPR1C6uz7y3Y6Z16iOTXJn3HRMNEwwPgb077XrwUkpcgIxHQbq7f7uMPATNqfWwKMXH3fxhTMkZOH0YdgViIfonFB0pagMKSzLg88nRe1bSz1G6CVea0WnZnHenNkrZK2zI0NU48VM1gMXIxvcRhpGYqeFxpWRtOg1EnLym0Ed7g197QcOsVkgGTM3CyKVHlMbyS4ec2i9DDDAj9fBUTcU6OOyGSjHxqJWC70EtC8W55RJ4WEO9Gz6OHuPT8mhSVxkmniGQgWfbDO5TNeTj7PY8DDR5jYNzlXL3ALdG2icvrBf49sH67Z44sg064DvKV67lcal4MnTxjsriKtJbiDA5Jq18nmc8M9NO9ZcfGqDjIosNH1iQYIL2sC0GO28qvgzuzB3zRwJULvxiQ9YEI3wuvQuDItU33jRseLRWBUacfxPV0DUyxgnmXHQZu4nnHyFL9R1BB17bSMqJKaBBLON2QXlaRyooXnuqyPR0HjvTVLWvgoqRw4dcloH3NVLAC5k1LwlMFGZULMKRu02Qo5nAkUXX9yRBY1s3RD9mDY7fAHqo1j5geMGo0XFZlQqDIdwTav68kxdeyttp6SZbYZTOMpDY5nr7UiRVDhThEqQ2dDLaPBbDqUh3Delzr60cebrciaNMUt8XqeX59s2pH9MaHr3ZoovWpMYyg6E0p7hab55ERYTor0TZLMitu7gKdy8Nu67exeIyDD2lVgzHAM0bpCvdz5N6XfJicGQzKosIlOTBoMCOpsk8U9bN4PdRUMtqiDkml6UxK7stKUBZcfXqesxC7AkmG76iBguMcJDhaV4KFv3bBkVFDi8AcMgIdQ8jFfQIIrIYlNXaGZBReBkn3eT9lWcSCb1BgbDisc67jU8Pd30huEYRdIQoun6qormYXP6JlxHuh9Ek2uVRtKywMfeAsEkaVwYcGoMRLNGmME0EsMlLQK7sjbS5F2zVTRrp53AbGAni4ehRkss0wUi9pu4pQtazariAPdBP7iYwQzd0RvkIfsHvg6eXpeQUZtO8wJOXR6j2vmSGc3ehPM6WIadrITF2cju2S8Q4ytWTG8qIvYjF4KrCeYohbT9IxXAJWK7O4nyAmiCb6fG1PXXUfF1hTuPKhJjxkLcIY4CEG4GC9cXjuf3zeoaXcPxNTbF3MHB45xzBr5xU7P3rUWlYElgG17Oe8j7ek29fpyaatxUUcOGq4RJ32P3nMHrfQSjuKMztaztXrIctQIeepN7hsvZy2gDdZh13TrnUkab5cdTSLXruASCmdrKA1I7QPYeyJrMUVijsl2ErPVLJEHpbs0Bk2yuHRyzqPGE5OORtGlKQ7QT5R96atyklqEm73focLSBp0idxuNHVXqQFpMFcEjnph3mE94bKhCu7fxY3EvOsgYrZ4q2z3fia9YFCTGcuC0rHnKAm5I8Fwpvr9nk2Ws2pg1Rt1oNYezZW9q8ys64PPp6O6gGS22C8ojWfxzx6YnSr7QQpge4VXuzT4z5WrxpFbbfy4CunPGEMmO2WSqHFf6SDviUhF9MaER3ykRftoK64SsRBcoAhPNLEVvLUYSVW3OkdvU1dYX8GJPBLxwTc9YbUNM8BYTnS11pRLgUz3mA6v1ITRVpQJq4Qx3LlgYxCjNjpTxihKIdz4LML02W3MQJDdkjOCGgMjpv3gDEkGHK4Nm9DIpxlAAiDLrhdYnjB6EYdCsRC0r078t4GJVl9mu6rfeuxV8Zm6NT26AYqmORO8Lkb10EdOAuT8ihogAAHdjzDdonp24xuaIZ12tyGUSTSuuABU08sD1pHfDqC1OW1QgmIzKINWV0hKqcuhagK10LBt23OGjampmoPrqsdbMkf3Q4EQaec0QDNc0sI9WopC6yTQkrlX5rQMlkslSYG2VN4Lz6LlOuOeS1U2i6PenZQyDCdQVdIGR7Mg3RWcb4gTV1f4rpCEIiwce3mZ7U0ilCSfjELOyR1Oc6cXPEVoghUObAECkYKwqs53raHjR2rostb8rrQ1y4G3uEZ8szYImT57T6g5YyNgliIDzSusMuP6YFzgynie7dbk9MJram2lZAiSj7aprQQglfmdsviT2jy2p7NpOF576HPJEQsW08wFdII0xkdqYBMd3TtbpS8PphSoXaah90MG2PwqZ4aNvgRSZETeQln5t5NK6hSz7u509WKtQK6FkNo9LBIrNpRAluaLCmazbzpaltXv3U1H1JbDaJoNs5HDqIISUILVCvqNOH9cruJN3Kg3NYb6Uc3aKCmZEre6gYeVwHrh10Uo5uLcjg83jwxnsdcWuLnB3rQps7xNrL1Q66TfdRCQHZ3Z2AgQFtLyerOwSFDagYQGUzLrLdBiwvCSpIzU1EizWqp8VS8wGj2Uc8cNF7qwsmeHU7VfC4ESknQA5jq5sMPuelCejmA5yE7i6SR2MPKr2UlXx5mPb1EgHAkkMefEIcg8VX01C4MYPrfcmrmSMkYjKCtQG3kI5qHkH1G9WiX542BKNhsprKzvcmbcflfF5MPC7lBTYSiSeKsllfBDPusmGuSg9XL5zqx16tKoFn6erSpCrQz7ESNbcvLFjmAc6Y3wL8KglGOCT44aeuBJGeKc4PHd18JrqDO15oBgpgcCE6CIUyhU6lW00uxls7Dc4L3ZZYzIyBa2175MvGwrSNic79Sp6PVuqijJ6IiZDMlvJgB4hrQt4sZ1rHKSmvc6DQa4SiTmoyHY98mgTwzOOo9AqKi6zk3xuxrd9EpnwWbvoS57eufndfNXjpTI3gzoDQrCOGQbWl0ExW5CKFjNKqAnFOpyUPMoZxQEx09NcZLzLHvmc8tgooXT2cMMRSuHgFF7vEL1tmrzngfTfyZtggH8jjf01z1B4wzquaLiQ2H4DgNc87Zfdwdm9iHvc2W6TPQdjsP0OQULWxNVu70ytxeXGfiI8y8RIjoRB4HJKVlxjsi7pCZdZ40Z9C1Bu0i29xe4Vf7v1MSE5uBkWrngPH5iDXeshmkKdS8YY5OPIwjDlehBZZHE07huUlMv1q5z93Rrsv60SJXxNzYDo0BIXcwbnCwfTV8mOP76bxrn6eKd72aPSCo98KEmHuVUfT6Tyxk3U5gkDknBdogpkYTi3nYAIdkhWKvP7FcRAj13XIYuq5K4nXHgEvGGzkOPU9YR8122ETpVWegcDk7Q7ErBZXCS8g2mJQ4HbW39aiVWQvYNFVuCTfxd2tVuzhHCs5DtlwXl9cBPxqtwFhsTmjWIDbxwj4ZBtsoEPFkiHLXyvKUvRce3mu6PvtbERuzaNO8Wji4lolJdWYyDu61GqXPMglKXFarMip2V2W6g8ajoYcRi8cjTZsZ5DzmD3DfFn8rfonPQRs4FugiXiVGCdv1boe8MbdhoFyXogCyXVXXf3zwFk2BRRtmA1kc2SNLRcy5ivYzgLmP8Lc7pyzBgSNaJsG5ajGRlzhXUznua39CFF3o4sPEEXEHfaDfNDqt21ggqXAURAQQzK4t2er11Vy6p1F3vVmRNWYxeSipMszc2Xvp1NgS2EiMwN9lzPwGBOx9x9o9sNbkB1zW8FF0aNC0V5FOK1kGGbFxbowt127WTxJRwIb0P8QA3Pe8HSEHU9yVnUIJgFZtwyET6GJg8UG1zfZAXXBHXZWEeuHkux8QVCzmCDsARssgxLbPz6mQqDOurm8LJ6WY3PEviqWZJIAAN5fG1Wmhp15aH4ggu2ynH3dQjZ9mxzNaYmHk8nrRIRSffYPzQIhnBkxe91V0qyuJKvTdJEULlCRqU0QAyrit59yy0joLbckfyxiB1xcdtTteeD8CoKWjKOH4rpFssj1QGELy1N5OxoS5mlxAVNKZrLUc1TuNxQt3kyVFbQj2zwXLHPbWsfMeR0gcd5PALCYp0JU1qxUPTbUqQpd9vjHGDhcaGRBhNp0DseYICcRleBCUl9naMoGJwcd2nEE0nutGzLI1OUGSPC605k0Hy0Ko2OhfMLzuzS0sY2jCMQOsiKMeoDfNXkvQsCp4HPo71IpP53LbdTXPuAncxXjk7Fup7KNFTw6KyPUtcZZfJMpxGCz3pJIQI2zF6dEP34Ure8fgX4Q0a5RHxh4hkCXmvnRrUQBNePyiNDp415Vwu63RdXYRqg3ftf0dprkt6I6JGP81ennyjKJR2yyMEWRrvHYKtCxpEXtaCVwa8dyhi8sa0RgY7XJsY1whtn1XbOs7zO81l0CtsVXMC3A3kDPDubeNSzBTdnR6vjXG9quWbLy79tuNW9ghElomej6iwhIlU0mngG9LLycKRwS7ZYItDXFIA5krGmCqcOEMODnqvTuGfcE4vcnstnuUMEFjl73ng10UZHEkrtRwZlVkRCDbjrpWqozBlsOVk8G9GENXXYNNDyrlvoQEGzqWNjRsCvegYKJuIQLwFoD8hUjC9t69SRVv06OWrSwfW53uMEkhTNJ02TWvGmup3JeoFSEq410QqTFwoP7BXHVPUHaqTYFhxKZwWtMRkC15mwr4GpvXWg6GNAq0oW7f0WBMKdtUaPPmFBgFQBs6bS6OimEwC65smw5W4Sb41kKxLQ2VLPRMxhUGYSwqiWJvi8LGkMAcXaz2kVip4t1sBfspYiF64IVHaxdl9Enq8gNjvVyqeUcFZuohCoe1WZyXmBCQzjAypdbeY3Yxh0w7kLehtMCf60wMVYsP7THQqIpJ5d6d4WEIxcPQPLqfBgRR5awwn3d75sG0v6xTT1sK47VdJbiEhZPGtb3ayA8tmEkH5HrO3doXa90dECcgVRgfn9JL3H5fGJhBK2JD5XU5reDpG9vskC1x5ADZC24CBbxF36DYnRo8WloWOdIYF3Q5YjUqbim6OJBb9y0QgIP2n3i16Rj6eZ12CfM7nY3v1Zx0nRbXpQj6dsr9D4zHUUAQZcOHvb2m0THIAIvjoFfVr0UUVOr9ylPSSXTdtfpjZqlpYb3Ga8rrtGFekWdcCmUkEDnXJ6A2ngLbhEcLDt2qtxu7N1aJHoTbmAspxThKZSLAnhbkBxAoUom1fmBgAOigf4vCNCc6lhw2p1cko62CkeuTUptP35VC0h4DJA4oIqKrMg50cXtQwN3gwnVpiHm8Og6RH0AJKaumhpdjG0u27n9t4ocdVoF3v5Lwpb50bTGM8dW83K10XuNSIQpu4oRTksfzXETZnqBPtRiRr9bJXPVZvaNTov7yNGsBbbUSrP2f1aqiDrlUA6JV6n9PI6HPCZg7vuQMacl1G5DDnPnNLq3cD2lFYSlUcrSxg2DgyjB4ey1rHezNYWPsO0X6cCkeo25uUz4MIvGgnx2V5ryUddGlxXL3qpCEixYwqS9sH9zU1rFWc3aJAGorutleIhIk80HpIabJD4tuPtLRQLULM82AVHEuicEhwF0y917DWUrBd2NoExZg0lGLnE5va46w3WUxOR045hZ9E6R8YGIOlIpycPocdk267MXfXhDSTslnT2lHynleV4CrdQtgvlHsruxICuqlMCyZYdwRqbVF6RW9yfgnUhFFBwdxQXcWT4MI7CpREEmAl83dHDqVKpUGLXxVfAcYuOwsgfDedQ8pi2sQvd5AsQ64DtjInl1ItRu4rX8uD7JMZwWOzReRxafvYpxb4oJo6xinlgHiHLow7aFwmJHJeN42wWxqa7EAuMh9njiUUwLR1KHdjeMnlbJHX7YryWSm3tmgCuumkzxbDyeNDluOQ4QDvEoTUA5NUhnm5c3g5qLzPkcMv0UboA8JyQsjhSW1tadpc6Z7RA00e2Cznm4BNwbFdXOkFBFZ5cIBD12kVTa0f6psiOUpEpVHczlcuQvpT3kmUd0FWuZ1qJk2nyiRNxTjq4lLfausxFELcYLYiAjy9XUml2ysThCaFhLKMzw9yuLAimoUg2igPxW1pON9pJDVlIZX7mqwG1qjHF3i1GoG3E1MjFfyIINTg7aeNr4jMkWOjQWamabJE2lh1rGAZNjAKO8n521HGNPkXBODBPcAcob3FbtYP7oTLm7aIsbJzRnni1QebT8dB9AAbUoQl7zqN0qQMrpcC6pLrzPsMhZdgqDhEmrjNlzqFj6iAPk3L383WhPzoF6up46ngRwnwpD2y4asJOPPbNIXonmCmNr5HnMNyC0VRXNJlh2VpH4qPCd3jU00xhpyuwbSYv7aMKJYRBd6D7QM3oFGCv0t6gRUCS7UH4UjFuBQpEhmBXYYFYv7NlqeV7YnjVCkQmYPapvUo66PopETHtROEBSq3H7GWzlCM9hgSD063rghae1HxcPv7yL0zd1lCciIbpPnm9kgqqnquIrle7GcZMwSPn3hTbkoVtC7sMHdwVXkXfZ2Gv4Z7qHM84oR626llyi7EQEu5sEm1te1iCQgTnmlh42HWsSBkv3OFx8AP6gaTl12NHC0oOb0dyxtkKVv5ODAFCuP2APMfHETIAdXeJNLBE5Lek69sA3XwRCSiMunjsAlS8CrHf28erJi5aMn49FURBCtdXGQJB2szudA4zy8RBKMBmuZmZJxUcQYZQE2LwkalnAfhsdYUN4PuoFaHexsgHKznesZ56tgOolVGSJqZ7ANQ5NR9EDKFd9TMVcHSvNwdshKEQuthUBXPIFjH8TcGmpi8rPQhWckeNocXJZ4tqSDZRgwjtyPFOX7zChGojlWqzYd8O8WykTn1ZJai8QhgDfFAmGO0R5gKnkdvMZUWI7N1Hh99XgJVPelwetmpSW06A3VcmFYo75f8de7uOGfYeUkje02WMSmHf8Jr72F4XK2uitPrtofy9TbHJ3XPgamlCq7ziCuzHQUja34tL9lemmLVK35Qxh1ZxsS9VczWTNznGuGLXSQayVV8OQObsa0jsdjHfcXsPnFPHGqYS6YgSef0on2GnmQaptbZvZLEGLjHh3vZukzGSEw6mo735h3OAzDpSfTok2prpKKJoDfA8CxkkudJBBov0lKIUtq4PFP4JT8sndSl9fZO3wnYr5jLhTNvc3ql2zg6jeowLAbLauT3QASCw1d7LRshect7Cz3L7LBIbCNbWw56rhyNCCedN0PRx8OZ1b4YMv0ir8jdYIDfjwmMYqj5LYM8WrrNWl53aqbrSOYGRVg0hWC5dM0iA7gRSxYEcUxcE2tQHLQowWIEJb3ghooblYS3lH1nVTTTLczMhfuDw3B5yvF9dnaobTLQUCxFlgorMN3TmSQIfi7D7CCajCokPZ0zVR47XMozTLMAtt8y5Av2wr2GoKQ33bXOSlfaYXzb3cBmZ4fUu4MQm8mAcxXz2KHeWNee48JXEbEtzJHTDNzjfgdh71GZ5dxRk6pf4Zw2u0PT3mCxZva45eF25Fl0cJcnFVW3eMVyDALwgHnzxoXsssPRX0btzHayXWV1zaUw4vSa36zqOmcA8RhpIMJBOJuB0fsTgcfa2rFpnyFvLbVJTwZr92mhBGIVguEQ1dkTvPCce7yjCjmlGF69xjgtjiepCJ5XMga7pCat3yCwbjHHOEGchgvqozGlC58JF9aV5aeZ2blykm5YQ6uXcjIVdI6FDye91fUXJsM6tru7DTqOPK5moD7rbxW9Vv8N4m47EaxsrRpoB92KeY'); insert into tm_t_jhseattrack (calltrackid, comid,inserttimeforhis,tasktargetid) values ('8', '123', '2018-08-08 11:11:11','QiETSk22V60KXd5uR3eJWb1L4RVEkCe0eIdrmzj7v9bMG66nuFWgGOl4Z629y6t79wolpxNL0inwJOd3j0Dj8OdrezrCwe3vBhak8hVYqDOZhSSUcl3atArxZctPhnEcuFmXMCL25qlGCxUEcN8vHTS0WGGxTa3H9fugb6CAQO6ibQMeXe3YXgPJMPAZjtwNzlT4LlvrtV3Z69xTdqc00l4C0uVDOMgHXtBy9qjscGh8F8lcpn2fyqcSLXmp3WqQKRIJClvERDCQ5NmkvJUTZq6AHMjB2zLCLObdZxHbuDlpKy457ijW2JRzl0udqAGveby325ym2K6CCu23CFPYe0npRcsBCsWGuk3mJs3BwtxYNpRJU0xsReHygutcgfcAT6hsoEneXK24uJDI301K42CFmVHt0enJaYvSWIWdjO77RAFKUwPjphO53PSnT6rnoM5blleYtcVE6UfRLUuuvCpSh86vyncMtCh8NmW7SbBiqaZ1oNlef4WRwScUzI1Ta8Rik8fwDaFTFYenCprHOeSaqoVQXM3XeK5TcEfG9eTE3YlZHDwlbJmrXB7KHu2L5XuBW47V8RT1FyQc1HS2g4O3ZfEwAw7ZNWqzQoOOz1GyqQ4LRM8XaMlZljlLFNAMzRGfzOnYGnQq4KvLnt3nzedLnSmmvhYoYYtRDb9DoPnipIo62hkVlRw2zJepQwD8lrjisMfarWjau1BQ8fCNWsFPvJyFz27KNgmzSVzDHc8w3zG1EC8qVDzgGYM6kJGrknQwCf0aMY0Fnw1RtZBetuOZiUVWYWd8DTu5tOz5CT4jKV03LVBygfRS0D9iTcgmq4LdJFCbowPYiFRnViLvSsdcpGk8JUOtOUwnpsTDOyWWxDDMge7Y1F0gbEJeoRx2BnKkFXikP4Acx4PDCgVXLfyNJ7lriJkeqooWbwAkqumiSvflC1CHA0Oar0rA358jNmzidZsXk95wYbHUwEsqu6UMqGGjBEtJkSRncEbQDAcr5ecVIYc2oW8Fs8Oo6BXhO8YQ6twzUylP6RBEFD1TTZScsxUosHv69kM6DCZRvaxrRYqQVhAEAiaS9UBWVWSVAZlyVEfgF62QoixDTr8j38wxnXN8dvn8Oyw435E2wwcK8zIRkGvI8l5l8cOFx1DGUtANpy9fVbjn5R5JRUhk5GZxID2Av0Afjum2Sl7DQLlLsgPauWkTX9Kv7CpsWP169HsmSqj2vu8N4NhozV7mpbcm8r8UBZk4wDgInqAIe2l9FtnzePftQh9O373YqdmgGtOTdJrhB7KBUs0Y75MhHfq4djmtQyAnlIAoLS0HPA8zSYRjnXVoxFiAiYnYnhbykChVO7sX1UQec1RqjC8G7L6JzNyMp3FzZMkDd7U4lACosk85g6BeH1NBEFHTzcioOXmlo6KzxchjQfeXG91d088Y8GIxIkfRBVwjS6JJ9QmPqUCWTXtdqs1Ss3f0IOb9AyjMumlXw17ML32Ylm15ESNWMSgO0MNUEqws6HKtyHzD4srfEiaCvNSBZsfkym42DrPzspmlqMOkyAUwIosx2aYlW3vlgUHdbm6X5j8lph0NHKDJYV7kVVwbjlQT5oWA4mo0vmbeXvlu5O4oz1yOgoQpAwCZeSq958tUOYZCkaWfPQtIbmniAx1unukWG4VB2ImGwbCGFpMkzzT5fAdGryuEm8qT2Fkod0pAvRA1AGFuASpFisF3k0yxsigPiU3PfMJAYaVoGrI6DX6MJBFoVxLealTM5grETvzbZkpv5sWzJSFNNE1zw670hkCGqnbDIAE1eonEaD3dP2kW0blm7MGIW8fHQgaSa9KeRrIlU5o3rzPi4vYw7Z4or9V7JpQJSUizbkKpKti1mrDgMWCeL1Ww0Hu4qED9of2pq7E0qglC1jc8zFGEws0QtkKJOIcwN5Lx2JRijxebGgDzf935rnMK2QNaSQxwL8T7c5fPsNQsTjRtMeo3ru7jbLkTrHJw9XtFS2lEFvWSFDbLHqFsKCCfHgtsh2OgjBMvXXZsiLFhIGTJqS2vOY4m4n8FKhLnIRJw8yiLaNmIOzi4hETqsOCQvAlzHqNK8mAAKIbeQShuhpSTn69Fe5PzZ0Z1KC5civDSx8rdQy1Yhebuaatez87SsWJ2SE50t2dR0uoHSgZZk0NOu6mT4j5QAFciD7DXta8kumRGsGZ60CKkyWxWAs60r88pA5GT5E3TQKpDKe34a8eyo5OOSKE9J7S9womsSgb3kVwptpjuRSS6h1KZBJtEGb72qkO8qQ145RjoBtIiFVeMMjCHSpcoq9KGNp93zuYuGBIBoLJTwiwCrs99HFRX9VYMara3fYnLTqc81gRRodj9vMCwiNkhyCn3TnWsFE4poAnJGyqU63nV9PihsWSloAeBN0TjYh2GIJfe7Zt3SGPSQXtCdGNr6RmdczQuHI1fL6NJWA687Lkh28J58nQ44wBAWiVtkM2WI9ZYAVX11B8nzbjxotVNQnHCZsp94Lp7eeVE0cZl8XyxtbpbZEOFlmBa8kE3VTuZYJYiMNXK5lBoRkpGPybue6vcgZzvITk0tCCzgpDbBypMJ8iSwNGAJ1DPkwaTgOd3hGsnVpSQNBsQz42WHzQgqNp5apOgyl9FRVm7a4NhvAYoukE2JlCuYSpYBxyZc1YUMERg2YSRoG6JkA5oLxc4JVmbiLuk6jydhJjay1Rg1NjGIeUN6WHFHoGjZvXV8QYfpCfhXrojy1P6AzewPfvQtwZiRgyPWQUcMujAL1JDTS4jL89qdu6xQp91Z1GMIVOOJreONhhwtbF4DEOHsK4Dtxujp1Vrg35POatrL4h5AMt3K8AxcY0wmk9BFomLLhUpLHbnCiMwp5pt3QQ68aWklVfkDrWezaXEcYlEBXuQnJDKpkaSkq2ZbCa8TqcMU0hWisUdKenrOR1xvwf9MCti4tghdjUXDvKfhujR30CHHuywkEwW6P40CFBFOlsLawkilXteOWLPK9cU7yGxH5n9AP8IuqNvhr7sfUwnGB2K44uwWvTtUBWOKUm4FtTMKkyP5o25jVGHju36jNT3eGHiUncpGqvh4nWZBjVKyVibfFBpilMQlOYz1vjyfE99mpZNyeSqZusyZTh8yoiJ279TsiL1gK0s0jASni9G6VzV8GnxUwAgt30fb5AMGqy0AschAbOwqHMpdZgslGy8ASH5O7bOoA8iSapNG3DWAfF85LUKiMJcvK7DI9Lq3dyfdNSJbQ05pZ3k5hpHUYJJ2acA9hkwkICRmOVRufMK4GoZNDw1VzAOA6I3dTqRVmzB0OiPTVTNVB72zXUknksNhvGOeqwZCprX336gOjTzKkW98GOlkAsVVYAtJqNF9ys2rSC61lZ60f5YfdDqEVbTd5dMlkikI4GZh8pCOJyEOYWU1TEZE9db5gOKqqVsOVhVo1ow4g0c4gqqZUfXUiYjS6TCm8UvUwKCRYYLzihtoyJHijuwVM9EJTAVRlK5bl1S9PXyX4mFsVG5yuVk7ViG8IVjTwfoH6Aagn33Mf3yuzXnUJxlYFRqd6zrsEFt5AubNRyTqriel5r58iKqNrGln66a45tZvhu9sTmIEuhPUyeSbO9iz9th5ThuP4jaG8DYRQ1la8vUwz71IAa7zteZdlNSKWmgoQ450VLuTAJKZGBxABZtp3MWJp8jGkpUuNkk3p9gPIk8Ig08HPVqIychNEUjPD4DheiaXhKCjVAR1qj25yj8WPJAkudtX7qyFy2s9DoiSjtJz6BZverho0b2OfP6G5uGYnsXkHA2Qn5Jk029zjKNEM9ilield3RvKaNUbdgRqbU4vN3UWE1UK03V8B6Guivyi8MjFSuWnekdleXCcPmg9J1CbrCZ3XobquOVHCbobmrmUfOqovwn4RjzCLTw3B1jVG4sCAHDMYk0xsgLN6tcNC5feOB7ftgvtENp4OTa73uuP4At0TZDlUdTz8Q8VqXIpBYNJHiG4Cvd1VwREPPjAm3tkdV6YJ8dEWkd'); -execute direct on (datanode1)'SELECT pg_drop_replication_slot(''regression_slot'');'; +SELECT pg_drop_replication_slot('regression_slot'); +WARNING: replicationSlotMinLSN is InvalidXLogRecPtr!!! +CONTEXT: referenced column: pg_drop_replication_slot +WARNING: replicationSlotMaxLSN is InvalidXLogRecPtr!!! +CONTEXT: referenced column: pg_drop_replication_slot pg_drop_replication_slot -------------------------- diff --git a/src/test/regress/expected/domain.out b/src/test/regress/expected/domain.out index d6bd44fb8..f56dd1b2c 100644 --- a/src/test/regress/expected/domain.out +++ b/src/test/regress/expected/domain.out @@ -45,6 +45,7 @@ create table basictest INSERT INTO basictest values ('88', 'haha', 'short', '123.12'); -- Good INSERT INTO basictest values ('88', 'haha', 'short text', '123.12'); -- Bad varchar ERROR: value too long for type character varying(5) +CONTEXT: referenced column: testvarchar INSERT INTO basictest values ('88', 'haha', 'short', '123.1212'); -- Truncate numeric -- Test copy COPY basictest (testvarchar) FROM stdin; -- fail @@ -61,12 +62,12 @@ select * from basictest order by 1, 2, 3, 4; -- check that domains inherit operations from base types select testtext || testvarchar as concat, testnumeric + 42 as sum -from basictest; +from basictest order by 1,2; concat | sum -----------+-------- hahashort | 165.12 hahashort | 165.12 - | + short | (3 rows) -- check that union/case/coalesce type resolution handles domains properly @@ -107,6 +108,7 @@ INSERT INTO domarrtest values ('{2,2}', '{{"a"},{"c"}}'); INSERT INTO domarrtest values (NULL, '{{"a","b","c"},{"d","e","f"}}'); INSERT INTO domarrtest values (NULL, '{{"toolong","b","c"},{"d","e","f"}}'); ERROR: value too long for type character varying(4) +CONTEXT: referenced column: testchar4arr select * from domarrtest order by 1, 2; testint4arr | testchar4arr ---------------+--------------------- @@ -127,13 +129,13 @@ select testint4arr[1], testchar4arr[2,2] from domarrtest order by 1, 2; | {{d,e,f}} (5 rows) -select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest; +select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order by 1, 2; array_dims | array_dims ------------+------------ - [1:2] | [1:2][1:2] - [1:2][1:2] | [1:1][1:2] - [1:2] | [1:3][1:2] [1:2] | [1:2][1:1] + [1:2] | [1:2][1:2] + [1:2] | [1:3][1:2] + [1:2][1:2] | [1:1][1:2] | [1:2][1:3] (5 rows) @@ -194,16 +196,20 @@ create table nulltest ); INSERT INTO nulltest DEFAULT VALUES; ERROR: domain dnotnull does not allow null values +CONTEXT: referenced column: col1 INSERT INTO nulltest values ('a', 'b', 'c', 'd', 'c'); -- Good insert into nulltest values ('a', 'b', 'c', 'd', NULL); ERROR: domain dcheck does not allow null values +CONTEXT: referenced column: col5 insert into nulltest values ('a', 'b', 'c', 'd', 'a'); ERROR: new row for relation "nulltest" violates check constraint "nulltest_col5_check" -DETAIL: Failing row contains (a, b, c, d, a). +DETAIL: N/A INSERT INTO nulltest values (NULL, 'b', 'c', 'd', 'd'); ERROR: domain dnotnull does not allow null values +CONTEXT: referenced column: col1 INSERT INTO nulltest values ('a', NULL, 'c', 'd', 'c'); ERROR: domain dnotnull does not allow null values +CONTEXT: referenced column: col2 INSERT INTO nulltest values ('a', 'b', NULL, 'd', 'c'); ERROR: null value in column "col3" violates not-null constraint DETAIL: Failing row contains (a, b, null, d, c). @@ -219,7 +225,7 @@ CONTEXT: COPY nulltest, line 1, column col5: null input -- Last row is bad COPY nulltest FROM stdin; ERROR: new row for relation "nulltest" violates check constraint "nulltest_col5_check" -DETAIL: Failing row contains (a, b, c, null, a). +DETAIL: N/A CONTEXT: COPY nulltest, line 3: "a b c \N a" select * from nulltest order by 1, 2, 3, 4, 5; col1 | col2 | col3 | col4 | col5 @@ -237,10 +243,13 @@ SELECT cast('1' as dnotnull); SELECT cast(NULL as dnotnull); -- fail ERROR: domain dnotnull does not allow null values +CONTEXT: referenced column: dnotnull SELECT cast(cast(NULL as dnull) as dnotnull); -- fail ERROR: domain dnotnull does not allow null values +CONTEXT: referenced column: dnotnull SELECT cast(col4 as dnotnull) from nulltest; -- fail ERROR: domain dnotnull does not allow null values +CONTEXT: referenced column: col4 -- cleanup drop table nulltest; drop domain dnotnull restrict; @@ -305,6 +314,7 @@ update domnotnull set col2 = 6; alter domain dnotnulltest set not null; update domnotnull set col1 = null; -- fails ERROR: domain dnotnulltest does not allow null values +CONTEXT: referenced column: col1 alter domain dnotnulltest drop not null; update domnotnull set col1 = null; drop domain dnotnulltest cascade; @@ -314,7 +324,7 @@ drop cascades to table domnotnull column col2 -- Test ALTER DOMAIN .. DEFAULT .. create table domdeftest (col1 ddef1); insert into domdeftest default values; -select * from domdeftest; +select * from domdeftest order by 1; col1 ------ 3 @@ -331,7 +341,7 @@ select * from domdeftest order by 1; alter domain ddef1 drop default; insert into domdeftest default values; -select * from domdeftest; +select * from domdeftest order by 1; col1 ------ 3 @@ -351,12 +361,15 @@ alter domain con add constraint t check (VALUE < 34); alter domain con add check (VALUE > 0); insert into domcontest values (-5); -- fails ERROR: value for domain con violates check constraint "con_check" +CONTEXT: referenced column: col1 insert into domcontest values (42); -- fails ERROR: value for domain con violates check constraint "t" +CONTEXT: referenced column: col1 insert into domcontest values (5); alter domain con drop constraint t; insert into domcontest values (-5); --fails ERROR: value for domain con violates check constraint "con_check" +CONTEXT: referenced column: col1 insert into domcontest values (42); alter domain con drop constraint nonexistent; ERROR: constraint "nonexistent" of domain "con" does not exist @@ -389,6 +402,7 @@ select * from domview order by 1; alter domain dom set not null; select * from domview; -- fail ERROR: domain dom does not allow null values +CONTEXT: referenced column: col1 alter domain dom drop not null; select * from domview order by 1; col1 @@ -400,6 +414,7 @@ select * from domview order by 1; alter domain dom add constraint domchkgt6 check(value > 6); select * from domview; --fail ERROR: value for domain dom violates check constraint "domchkgt6" +CONTEXT: referenced column: col1 alter domain dom drop constraint domchkgt6 restrict; select * from domview order by 1; col1 @@ -433,24 +448,34 @@ select 'x1234'::dtop; -- explicit coercion should truncate select 'y1234'::dtop; -- fail ERROR: value for domain dtop violates check constraint "dinter_check" +CONTEXT: referenced column: dtop select 'y123'::dtop; -- fail ERROR: value for domain dtop violates check constraint "dinter_check" +CONTEXT: referenced column: dtop select 'yz23'::dtop; -- fail ERROR: value for domain dtop violates check constraint "dinter_check" +CONTEXT: referenced column: dtop select 'xz23'::dtop; -- fail ERROR: value for domain dtop violates check constraint "dtop_check" +CONTEXT: referenced column: dtop +-- Enforce use of COMMIT instead of 2PC for temporary objects create temp table dtest(f1 dtop); insert into dtest values('x123'); insert into dtest values('x1234'); -- fail, implicit coercion ERROR: value too long for type character varying(4) +CONTEXT: referenced column: f1 insert into dtest values('y1234'); -- fail, implicit coercion ERROR: value too long for type character varying(4) +CONTEXT: referenced column: f1 insert into dtest values('y123'); -- fail ERROR: value for domain dtop violates check constraint "dinter_check" +CONTEXT: referenced column: f1 insert into dtest values('yz23'); -- fail ERROR: value for domain dtop violates check constraint "dinter_check" +CONTEXT: referenced column: f1 insert into dtest values('xz23'); -- fail ERROR: value for domain dtop violates check constraint "dtop_check" +CONTEXT: referenced column: f1 drop table dtest; drop domain vchar4 cascade; NOTICE: drop cascades to 2 other objects @@ -494,6 +519,7 @@ end$$ language plpgsql; select doubledecrement(3); -- fail because of implicit null assignment ERROR: domain pos_int does not allow null values CONTEXT: PL/pgSQL function doubledecrement(pos_int) line 3 during statement block local variable initialization +referenced column: doubledecrement create or replace function doubledecrement(p1 pos_int) returns pos_int as $$ declare v pos_int := 0; begin @@ -502,6 +528,7 @@ end$$ language plpgsql; select doubledecrement(3); -- fail at initialization assignment ERROR: value for domain pos_int violates check constraint "pos_int_check" CONTEXT: PL/pgSQL function doubledecrement(pos_int) line 3 during statement block local variable initialization +referenced column: doubledecrement create or replace function doubledecrement(p1 pos_int) returns pos_int as $$ declare v pos_int := 1; begin @@ -510,14 +537,18 @@ begin end$$ language plpgsql; select doubledecrement(null); -- fail before call ERROR: domain pos_int does not allow null values +CONTEXT: referenced column: doubledecrement select doubledecrement(0); -- fail before call ERROR: value for domain pos_int violates check constraint "pos_int_check" +CONTEXT: referenced column: doubledecrement select doubledecrement(1); -- fail at assignment to v ERROR: value for domain pos_int violates check constraint "pos_int_check" CONTEXT: PL/pgSQL function doubledecrement(pos_int) line 4 at assignment +referenced column: doubledecrement select doubledecrement(2); -- fail at return ERROR: value for domain pos_int violates check constraint "pos_int_check" CONTEXT: PL/pgSQL function doubledecrement(pos_int) while casting return value to function's return type +referenced column: doubledecrement select doubledecrement(3); -- good doubledecrement ----------------- @@ -543,8 +574,10 @@ create domain posint2 as posint check (value % 2 = 0); create table ddtest2(f1 posint2); insert into ddtest2 values(11); -- fail ERROR: value for domain posint2 violates check constraint "posint2_check" +CONTEXT: referenced column: f1 insert into ddtest2 values(-2); -- fail ERROR: value for domain posint2 violates check constraint "c1" +CONTEXT: referenced column: f1 insert into ddtest2 values(2); alter domain posint add constraint c2 check(value >= 10); -- fail ERROR: column "f1" of table "ddtest2" contains values that violate the new constraint @@ -567,6 +600,7 @@ select array_elem_check(121.00); ERROR: numeric field overflow DETAIL: A field with precision 4, scale 2 must round to an absolute value less than 10^2. CONTEXT: PL/pgSQL function array_elem_check(numeric) line 5 at assignment +referenced column: array_elem_check select array_elem_check(1.23456); array_elem_check ------------------ @@ -585,6 +619,7 @@ select array_elem_check(121.00); ERROR: numeric field overflow DETAIL: A field with precision 4, scale 2 must round to an absolute value less than 10^2. CONTEXT: PL/pgSQL function array_elem_check(numeric) line 5 at assignment +referenced column: array_elem_check select array_elem_check(1.23456); array_elem_check ------------------ @@ -603,6 +638,7 @@ select array_elem_check(121.00); ERROR: numeric field overflow DETAIL: A field with precision 4, scale 2 must round to an absolute value less than 10^2. CONTEXT: PL/pgSQL function array_elem_check(numeric) line 5 at assignment +referenced column: array_elem_check select array_elem_check(1.23456); array_elem_check ------------------ @@ -622,13 +658,16 @@ select array[1,2]::orderedpair; select array[2,1]::orderedpair; -- fail ERROR: value for domain orderedpair violates check constraint "orderedpair_check" +CONTEXT: referenced column: array create temp table op (f1 orderedpair); insert into op values (array[1,2]); insert into op values (array[2,1]); -- fail ERROR: value for domain orderedpair violates check constraint "orderedpair_check" +CONTEXT: referenced column: f1 update op set f1[2] = 3; update op set f1[2] = 0; -- fail ERROR: value for domain orderedpair violates check constraint "orderedpair_check" +CONTEXT: referenced column: f1 select * from op; f1 ------- @@ -651,6 +690,7 @@ select array_elem_check(3); select array_elem_check(-1); ERROR: value for domain orderedpair violates check constraint "orderedpair_check" CONTEXT: PL/pgSQL function array_elem_check(integer) line 5 at assignment +referenced column: array_elem_check drop function array_elem_check(int); -- -- Renaming @@ -663,6 +703,4 @@ drop domain testdomain3; -- Renaming domain constraints -- create domain testdomain1 as int constraint unsigned check (value > 0); -alter domain testdomain1 rename constraint unsigned to unsigned_foo; -alter domain testdomain1 drop constraint unsigned_foo; drop domain testdomain1; diff --git a/src/test/regress/expected/hll_xc.out b/src/test/regress/expected/hll_xc.out index e76bb52e3..3964ed467 100644 --- a/src/test/regress/expected/hll_xc.out +++ b/src/test/regress/expected/hll_xc.out @@ -53,19 +53,19 @@ select weekday, #hll_add_agg(hll_hash_integer(id)) as unique_users from traffic weekday | unique_users ---------+------------------ 1 | 100 - 2 | 203.813355588808 - 3 | 308.048239950384 - 4 | 410.529188080374 - 5 | 514.549096958669 - 6 | 513.263875705319 - 7 | 513.263875705319 + 2 | 200.217861303237 + 3 | 301.76494508014 + 4 | 400.862650860414 + 5 | 502.626444091693 + 6 | 502.626933349694 + 7 | 502.626933349694 (7 rows) -- should be around 500 select #hll_union_agg(users) from report; ?column? ------------------ - 514.549096958669 + 503.657946119357 (1 row) drop table traffic; @@ -103,20 +103,20 @@ SELECT date, hll_cardinality(users) FROM daily_uniques order by date; date | hll_cardinality --------------------------+------------------ Wed Feb 20 00:00:00 2019 | 100 - Thu Feb 21 00:00:00 2019 | 203.813355588808 - Fri Feb 22 00:00:00 2019 | 308.048239950384 - Sat Feb 23 00:00:00 2019 | 410.529188080374 - Sun Feb 24 00:00:00 2019 | 513.263875705319 - Mon Feb 25 00:00:00 2019 | 609.271181107416 - Tue Feb 26 00:00:00 2019 | 702.941844662509 - Wed Feb 27 00:00:00 2019 | 792.249946595237 + Thu Feb 21 00:00:00 2019 | 200.217913059312 + Fri Feb 22 00:00:00 2019 | 301.76494508014 + Sat Feb 23 00:00:00 2019 | 400.862858326446 + Sun Feb 24 00:00:00 2019 | 502.626933349694 + Mon Feb 25 00:00:00 2019 | 601.922606454213 + Tue Feb 26 00:00:00 2019 | 696.602316769498 + Wed Feb 27 00:00:00 2019 | 798.111731634412 (8 rows) -- ask for one week uniques SELECT hll_cardinality(hll_union_agg(users)) FROM daily_uniques WHERE date >= '2019-02-20'::date AND date <= '2019-02-26'::date; hll_cardinality ------------------ - 702.941844662509 + 696.602316769498 (1 row) -- or a sliding window of uniques over the past 6 days @@ -126,13 +126,13 @@ WINDOW seven_days AS (ORDER BY date ASC ROWS 6 PRECEDING); date | ?column? --------------------------+------------------ Wed Feb 20 00:00:00 2019 | 100 - Thu Feb 21 00:00:00 2019 | 203.813355588808 - Fri Feb 22 00:00:00 2019 | 308.048239950384 - Sat Feb 23 00:00:00 2019 | 410.529188080374 - Sun Feb 24 00:00:00 2019 | 513.263875705319 - Mon Feb 25 00:00:00 2019 | 609.271181107416 - Tue Feb 26 00:00:00 2019 | 702.941844662509 - Wed Feb 27 00:00:00 2019 | 792.249946595237 + Thu Feb 21 00:00:00 2019 | 200.217913059312 + Fri Feb 22 00:00:00 2019 | 301.76494508014 + Sat Feb 23 00:00:00 2019 | 400.862858326446 + Sun Feb 24 00:00:00 2019 | 502.626933349694 + Mon Feb 25 00:00:00 2019 | 601.922606454213 + Tue Feb 26 00:00:00 2019 | 696.602316769498 + Wed Feb 27 00:00:00 2019 | 798.111731634412 (8 rows) -- or the number of uniques you saw yesterday that you did not see today @@ -170,7 +170,7 @@ select hll_cardinality(hll_add_agg(hll_text)) , hll_cardinality(hll_add_agg(hll_ ) x; hll_cardinality | hll_cardinality ------------------+------------------ - 1017.70298739098 | 492.809273714462 + 995.709856341669 | 502.624949567292 (1 row) select hll_cardinality(hll_union_agg(hll_add_value)) @@ -180,7 +180,7 @@ select hll_cardinality(hll_union_agg(hll_add_value)) ) x; hll_cardinality ------------------ - 492.809273714462 + 502.624949567292 (1 row) select hll_cardinality(hll_union_agg(hll_add_value)) @@ -190,7 +190,7 @@ select hll_cardinality(hll_union_agg(hll_add_value)) ) x; hll_cardinality ------------------ - 504.289839437176 + 496.450281194173 (1 row) select hll_cardinality(hll_union_agg(hll_add_value)) @@ -203,7 +203,7 @@ select hll_cardinality(hll_union_agg(hll_add_value)) ) x; hll_cardinality ------------------ - 1017.70298739098 + 995.709856341669 (1 row) insert into test_name1 @@ -213,7 +213,7 @@ insert into test_name1 select hll_cardinality(hll_union_agg(name1)) from test_name1; hll_cardinality ------------------ - 510.695850290471 + 499.542425550241 (1 row) insert into test_name1_name2 @@ -223,7 +223,7 @@ insert into test_name1_name2 select hll_cardinality(hll_union_agg(name1_name2)) from test_name1_name2; hll_cardinality ------------------ - 504.289839437176 + 496.450281194173 (1 row) drop table test_hll; @@ -249,56 +249,56 @@ insert into t_b_cd_hll select b, hll_add_agg(hll_hash_text(c||d)) from t_data g select a, #c from t_a_c_hll order by a; a | ?column? ---+------------------ - 0 | 250.741759091658 - 1 | 250.741759091658 + 0 | 247.862354346299 + 1 | 250.908710610377 (2 rows) select a, #cd from t_a_cd_hll order by a; a | ?column? ---+------------------ - 0 | 250.741759091658 - 1 | 245.098327579089 + 0 | 249.894992356239 + 1 | 250.910160017494 (2 rows) select b, #c from t_b_c_hll order by b; b | ?column? ---+------------------ - 0 | 165.511411011356 - 1 | 169.852695095884 - 2 | 170.939455535288 + 0 | 165.837309898492 + 1 | 164.828002932655 + 2 | 166.848221800016 (3 rows) select b, #cd from t_b_cd_hll order by b; b | ?column? ---+------------------ - 0 | 167.680902739657 - 1 | 164.427526360495 - 2 | 164.427526360495 + 0 | 164.828159955429 + 1 | 167.858709928037 + 2 | 165.838429363155 (3 rows) --should all be around 500 select #hll_union_agg(c) from t_a_c_hll; ?column? ------------------ - 496.628982624022 + 498.496062953313 (1 row) select #hll_union_agg(cd) from t_a_cd_hll; ?column? ------------------ - 495.354954589157 + 499.540451882883 (1 row) select #hll_union_agg(c) from t_b_c_hll; ?column? ------------------ - 496.628982624022 + 498.496062953313 (1 row) select #hll_union_agg(cd) from t_b_cd_hll; ?column? ------------------ - 495.354954589157 + 499.540451882883 (1 row) --prepare @@ -306,13 +306,13 @@ prepare p1(int) as select a, hll_cardinality( hll_add_agg(hll_hash_text(c)) || h execute p1(0); a | hll_cardinality ---+------------------ - 0 | 250.741759091658 + 0 | 247.862354346299 (1 row) execute p1(1); a | hll_cardinality ---+------------------ - 1 | 250.741759091658 + 1 | 250.908710610377 (1 row) deallocate p1; @@ -320,19 +320,19 @@ prepare p2(int) as select b, hll_cardinality( hll_add_agg(hll_hash_text(c)) || h execute p2(0); b | hll_cardinality ---+------------------ - 0 | 165.511411011356 + 0 | 165.837309898492 (1 row) execute p2(1); b | hll_cardinality ---+------------------ - 1 | 169.852695095884 + 1 | 164.828002932655 (1 row) execute p2(2); b | hll_cardinality ---+------------------ - 2 | 170.939455535288 + 2 | 166.848221800016 (1 row) deallocate p2; @@ -342,13 +342,13 @@ declare c cursor for select a, hll_cardinality( hll_add_agg(hll_hash_text(c)) | fetch next from c; a | hll_cardinality ---+------------------ - 0 | 250.741759091658 + 0 | 247.862354346299 (1 row) fetch next from c; a | hll_cardinality ---+------------------ - 1 | 250.741759091658 + 1 | 250.908710610377 (1 row) close c; @@ -358,19 +358,19 @@ declare c cursor for select b, hll_cardinality( hll_add_agg(hll_hash_text(c)) | fetch next from c; b | hll_cardinality ---+------------------ - 0 | 165.511411011356 + 0 | 165.837309898492 (1 row) fetch next from c; b | hll_cardinality ---+------------------ - 1 | 169.852695095884 + 1 | 164.828002932655 (1 row) fetch next from c; b | hll_cardinality ---+------------------ - 2 | 170.939455535288 + 2 | 166.848221800016 (1 row) close c; diff --git a/src/test/regress/expected/hw_dynanonymous_sql.out b/src/test/regress/expected/hw_dynanonymous_sql.out index 0790dad2d..4c071614f 100644 --- a/src/test/regress/expected/hw_dynanonymous_sql.out +++ b/src/test/regress/expected/hw_dynanonymous_sql.out @@ -8,8 +8,8 @@ create table test_schema.test_table( ADDRESS varchar2(20) NOT NULL, TELE varchar2(20) DEFAULT '101' ); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "TEST_TABLE_PKEY" for table "TEST_TABLE" -NOTICE: CREATE TABLE / UNIQUE will create implicit index "TEST_TABLE_NAME_KEY" for table "TEST_TABLE" +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_table_pkey" for table "test_table" +NOTICE: CREATE TABLE / UNIQUE will create implicit index "test_table_name_key" for table "test_table" insert into test_schema.test_table values(1,'steve',10,'adsf'); insert into test_schema.test_table values(2,'warfield',20,'zcv','234'); insert into test_schema.test_table values(3,'henry',30,'zcv','567'); @@ -33,7 +33,7 @@ $$LANGUAGE plpgsql; call sp_declare1(); INFO: NAME1 is steve INFO: NAME2 is warfield - SP_DECLARE1 + sp_declare1 ------------- 0 (1 row) @@ -65,7 +65,7 @@ call sp_declare2(); INFO: ID is 1 INFO: ID is 2 INFO: ID is 3 - SP_DECLARE2 + sp_declare2 ------------- 0 (1 row) @@ -98,7 +98,7 @@ INFO: NAME is steve INFO: AGE is 10 INFO: ADDRESS is adsf INFO: TELE is 101 - SP_BLOCK1 + sp_block1 ----------- 0 (1 row) @@ -128,21 +128,24 @@ END; $$LANGUAGE plpgsql; select sp_block2(1000); INFO: EXCEPTION is NO_DATA_FOUND - SP_BLOCK2 +CONTEXT: referenced column: sp_block2 + sp_block2 ----------- 0 (1 row) select sp_block2(2); INFO: name is henry - SP_BLOCK2 +CONTEXT: referenced column: sp_block2 + sp_block2 ----------- 0 (1 row) select sp_block2(0); INFO: EXCEPTION is TOO_MANY_ROWS - SP_BLOCK2 +CONTEXT: referenced column: sp_block2 + sp_block2 ----------- 0 (1 row) @@ -165,7 +168,7 @@ END; $$LANGUAGE plpgsql; call sp_block3(); INFO: NAME is steve - SP_BLOCK3 + sp_block3 ----------- 0 (1 row) @@ -187,7 +190,7 @@ END; $$LANGUAGE plpgsql; call sp_block4(); INFO: TELE IS MMM - SP_BLOCK4 + sp_block4 ----------- 0 (1 row) @@ -207,7 +210,8 @@ END; $$LANGUAGE plpgsql; select sp_block5('MMM'); INFO: TELE IS MMM - SP_BLOCK5 +CONTEXT: referenced column: sp_block5 + sp_block5 ----------- 0 (1 row) @@ -239,9 +243,9 @@ call sp_tempsp6(); NOTICE: MYCHAR is THIS IS TEST CONTEXT: SQL statement "call sp_block6(:a)" PL/pgSQL function inline_code_block line 1 at EXECUTE statement -PL/pgSQL function SP_TEMPSP6() line 7 at EXECUTE statement +PL/pgSQL function sp_tempsp6() line 8 at EXECUTE statement INFO: MYCHAR is sp_block is called - SP_TEMPSP6 + sp_tempsp6 ------------ 0 (1 row) @@ -280,9 +284,9 @@ call sp_tempsp7(); INFO: MYINTEGER is 1 CONTEXT: SQL statement "call sp_block7(:a,:b)" PL/pgSQL function inline_code_block line 1 at EXECUTE statement -PL/pgSQL function SP_TEMPSP7() line 8 at EXECUTE statement +PL/pgSQL function sp_tempsp7() line 9 at EXECUTE statement INFO: MYCHAR is sp_block is called - SP_TEMPSP7 + sp_tempsp7 ------------ 0 (1 row) @@ -301,7 +305,7 @@ END; $$LANGUAGE plpgsql; call sp_block8(:a); NOTICE: NAME is warfield - RETURNCODE + returncode ------------ (1 row) @@ -320,7 +324,7 @@ END; $$LANGUAGE plpgsql; call sp_block9(:a); NOTICE: NAME is steve - RETURNCODE + returncode ------------ (1 row) @@ -360,7 +364,7 @@ call sp_block11(); INFO: result is:101 INFO: result is:202 INFO: result is:404 - SP_BLOCK11 + sp_block11 ------------ (1 row) @@ -389,7 +393,7 @@ BEGIN END; $$LANGUAGE plpgsql; call sp_insert1(); - SP_INSERT1 + sp_insert1 ------------ 0 (1 row) @@ -487,8 +491,8 @@ begin using in b, in c; end; / -ERROR: query has no destination for result data -CONTEXT: PL/pgSQL function inline_code_block line 8 at EXECUTE statement +ERROR: query has no destination for result data in EXECUTE statement +CONTEXT: PL/pgSQL function inline_code_block line 7 at EXECUTE statement drop table test; CREATE OR REPLACE PROCEDURE sp_test_1 ( @@ -541,7 +545,7 @@ begin end; / select * from test; - ID | NAME | ADD1 + id | name | add1 ----+-----------+----------- 4 | july | henan 6 | june | xian @@ -558,6 +562,11 @@ AS BEGIN END SP_HW_SUB_ADDMODULES ; / +ERROR: end label "sp_hw_sub_addmodules" specified for unlabelled block +LINE 2: END SP_HW_SUB_ADDMODULES + ^ +QUERY: DECLARE BEGIN +END SP_HW_SUB_ADDMODULES create or replace PROCEDURE sp_test ( temp IN varchar2 @@ -574,12 +583,14 @@ BEGIN EXECUTE IMMEDIATE PSV_SQL; END; / +ERROR: schema "dbms_output" does not exist +CONTEXT: compilation of PL/pgSQL function "sp_test" near line 3 call sp_test('jack'); -BEGIN SP_HW_SUB_ADDMODULES(:1,'jack'); END; -ERROR: the number of place holders doesn't match the number of parameters. -CONTEXT: PL/pgSQL function SP_TEST(CHARACTER VARYING) line 9 at EXECUTE statement +ERROR: function "sp_test" doesn't exist drop procedure SP_HW_SUB_ADDMODULES; +ERROR: function sp_hw_sub_addmodules does not exist drop procedure sp_test; +ERROR: function sp_test does not exist --Dynamic SQL Anonymous Block TEST --CREATE schema and table ,INSERT data CREATE SCHEMA test_schema; @@ -590,8 +601,8 @@ create table test_schema.test_table( ADDRESS varchar2(20) NOT NULL, TELE varchar2(20) DEFAULT '101' ); -NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "TEST_TABLE_PKEY" for table "TEST_TABLE" -NOTICE: CREATE TABLE / UNIQUE will create implicit index "TEST_TABLE_NAME_KEY" for table "TEST_TABLE" +NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_table_pkey" for table "test_table" +NOTICE: CREATE TABLE / UNIQUE will create implicit index "test_table_name_key" for table "test_table" insert into test_schema.test_table values(1,'steve',10,'adsf'); insert into test_schema.test_table values(2,'warfield',20,'zcv','234'); insert into test_schema.test_table values(3,'henry',30,'zcv','567'); @@ -615,7 +626,7 @@ $$LANGUAGE plpgsql; call sp_declare1(); INFO: NAME1 is steve INFO: NAME2 is warfield - SP_DECLARE1 + sp_declare1 ------------- 0 (1 row) @@ -647,7 +658,7 @@ call sp_declare2(); INFO: ID is 1 INFO: ID is 2 INFO: ID is 3 - SP_DECLARE2 + sp_declare2 ------------- 0 (1 row) @@ -680,7 +691,7 @@ INFO: NAME is steve INFO: AGE is 10 INFO: ADDRESS is adsf INFO: TELE is 101 - SP_BLOCK1 + sp_block1 ----------- 0 (1 row) @@ -710,21 +721,24 @@ END; $$LANGUAGE plpgsql; select sp_block2(1000); INFO: EXCEPTION is NO_DATA_FOUND - SP_BLOCK2 +CONTEXT: referenced column: sp_block2 + sp_block2 ----------- 0 (1 row) select sp_block2(2); INFO: name is henry - SP_BLOCK2 +CONTEXT: referenced column: sp_block2 + sp_block2 ----------- 0 (1 row) select sp_block2(0); INFO: EXCEPTION is TOO_MANY_ROWS - SP_BLOCK2 +CONTEXT: referenced column: sp_block2 + sp_block2 ----------- 0 (1 row) @@ -747,7 +761,7 @@ END; $$LANGUAGE plpgsql; call sp_block3(); INFO: NAME is steve - SP_BLOCK3 + sp_block3 ----------- 0 (1 row) @@ -769,7 +783,7 @@ END; $$LANGUAGE plpgsql; call sp_block4(); INFO: TELE IS MMM - SP_BLOCK4 + sp_block4 ----------- 0 (1 row) @@ -789,7 +803,8 @@ END; $$LANGUAGE plpgsql; select sp_block5('MMM'); INFO: TELE IS MMM - SP_BLOCK5 +CONTEXT: referenced column: sp_block5 + sp_block5 ----------- 0 (1 row) @@ -821,9 +836,9 @@ call sp_tempsp6(); NOTICE: MYCHAR is THIS IS TEST CONTEXT: SQL statement "call sp_block6(:a)" PL/pgSQL function inline_code_block line 1 at EXECUTE statement -PL/pgSQL function SP_TEMPSP6() line 7 at EXECUTE statement +PL/pgSQL function sp_tempsp6() line 8 at EXECUTE statement INFO: MYCHAR is sp_block is called - SP_TEMPSP6 + sp_tempsp6 ------------ 0 (1 row) @@ -862,9 +877,9 @@ call sp_tempsp7(); INFO: MYINTEGER is 1 CONTEXT: SQL statement "call sp_block7(:a,:b)" PL/pgSQL function inline_code_block line 1 at EXECUTE statement -PL/pgSQL function SP_TEMPSP7() line 8 at EXECUTE statement +PL/pgSQL function sp_tempsp7() line 9 at EXECUTE statement INFO: MYCHAR is sp_block is called - SP_TEMPSP7 + sp_tempsp7 ------------ 0 (1 row) @@ -883,7 +898,7 @@ END; $$LANGUAGE plpgsql; call sp_block8(:a); NOTICE: NAME is warfield - RETURNCODE + returncode ------------ (1 row) @@ -902,7 +917,7 @@ END; $$LANGUAGE plpgsql; call sp_block9(:a); NOTICE: NAME is steve - RETURNCODE + returncode ------------ (1 row) @@ -942,7 +957,7 @@ call sp_block11(); INFO: result is:101 INFO: result is:202 INFO: result is:404 - SP_BLOCK11 + sp_block11 ------------ (1 row) @@ -971,7 +986,7 @@ BEGIN END; $$LANGUAGE plpgsql; call sp_insert1(); - SP_INSERT1 + sp_insert1 ------------ 0 (1 row) @@ -1069,8 +1084,8 @@ begin using in b, in c; end; / -ERROR: query has no destination for result data -CONTEXT: PL/pgSQL function inline_code_block line 8 at EXECUTE statement +ERROR: query has no destination for result data in EXECUTE statement +CONTEXT: PL/pgSQL function inline_code_block line 7 at EXECUTE statement drop table test; CREATE OR REPLACE PROCEDURE sp_test_1 ( @@ -1123,7 +1138,7 @@ begin end; / select * from test; - ID | NAME | ADD1 + id | name | add1 ----+-----------+----------- 4 | july | henan 6 | june | xian @@ -1131,34 +1146,3 @@ select * from test; (3 rows) drop table test; -CREATE OR REPLACE PROCEDURE "SP_HW_SUB_ADDMODULES" -( - returncode OUT integer, - PSV_MODULEDESC IN VARCHAR2 -) -AS -BEGIN -END SP_HW_SUB_ADDMODULES ; -/ -create or replace PROCEDURE sp_test -( -temp IN varchar2 -) -AS - PSV_SQL VARCHAR2(200); -BEGIN - PSV_SQL := 'BEGIN ' - ||'SP_HW_SUB_ADDMODULES(' - ||':1,' - ||''''||to_char(TEMP)||'''' - ||'); END;'; - dbms_output.put_line(PSV_SQL); - EXECUTE IMMEDIATE PSV_SQL; -END; -/ -call sp_test('jack'); -BEGIN SP_HW_SUB_ADDMODULES(:1,'jack'); END; -ERROR: the number of place holders doesn't match the number of parameters. -CONTEXT: PL/pgSQL function SP_TEST(CHARACTER VARYING) line 9 at EXECUTE statement -drop procedure SP_HW_SUB_ADDMODULES; -drop procedure sp_test; diff --git a/src/test/regress/expected/hw_partition_nodes.out b/src/test/regress/expected/hw_partition_nodes.out index 33852f8e1..1d528124f 100644 --- a/src/test/regress/expected/hw_partition_nodes.out +++ b/src/test/regress/expected/hw_partition_nodes.out @@ -26,7 +26,7 @@ SELECT PG_GET_VIEWDEF('VIEW_TEST1_P'); SET ENABLE_SEQSCAN = FALSE; SET ENABLE_BITMAPSCAN = FALSE; EXPLAIN (COSTS off) SELECT * FROM TEST1_P WHERE TEST1_F1 > 5000; - QUERY PLAN + QUERY PLAN --------------------------------------------------------------------- Partition Iterator Iterations: 0 diff --git a/src/test/regress/expected/hw_partition_pruning.out b/src/test/regress/expected/hw_partition_pruning.out index ee5330bda..24a6d9301 100644 --- a/src/test/regress/expected/hw_partition_pruning.out +++ b/src/test/regress/expected/hw_partition_pruning.out @@ -128,769 +128,690 @@ insert into t_pruning_datatype_int32 values(-100,20,20,'a'), --1.1.2.1 = -BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 = 50) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 = 50) + Selected Partitions: 1 +(3 rows) --1.1.2.2 = BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 = 100) - Selected Partitions: 2 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 = 100) + Selected Partitions: 2 +(3 rows) --1.1.2.3 = -BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=250; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 = 250) - Selected Partitions: 3 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 = 250) + Selected Partitions: 3 +(3 rows) --1.1.2.6 = BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=500; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 = 500) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 = 500) + Selected Partitions: NONE +(5 rows) --1.1.2.7 = +BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1=550; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 = 550) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 = 550) + Selected Partitions: NONE +(5 rows) --1.1.1.1 < -BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 < 50) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 < 50) + Selected Partitions: 1 +(3 rows) --1.1.1.2 <= -BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 <= 50) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 <= 50) + Selected Partitions: 1 +(3 rows) --1.1.1.3 < BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 < 100) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 < 100) + Selected Partitions: 1 +(3 rows) --1.1.1.4 <= BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 <= 100) - Selected Partitions: 1..2 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 <= 100) + Selected Partitions: 1..2 +(5 rows) --1.1.1.5 < -BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<150; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 < 150) - Selected Partitions: 1..2 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 < 150) + Selected Partitions: 1..2 +(5 rows) --1.1.1.7 < BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<200; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 < 200) - Selected Partitions: 1..2 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 < 200) + Selected Partitions: 1..2 +(5 rows) --1.1.1.8 <= BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=200; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 <= 200) - Selected Partitions: 1..3 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 <= 200) + Selected Partitions: 1..3 +(5 rows) --1.1.1.11 < BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<500; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 < 500) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 < 500) + Selected Partitions: 1..4 +(5 rows) --1.1.1.12 <= BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=500; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 <= 500) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 <= 500) + Selected Partitions: 1..4 +(5 rows) --1.1.1.13 < +BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<700; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 < 700) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 < 700) + Selected Partitions: 1..4 +(5 rows) --1.1.1.14 <= +BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<=700; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 <= 700) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 <= 700) + Selected Partitions: 1..4 +(5 rows) --1.1.3.1 > -BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 > 50) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 > 50) + Selected Partitions: 1..4 +(5 rows) --1.1.3.2 >= -BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 >= 50) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 >= 50) + Selected Partitions: 1..4 +(5 rows) --1.1.3.3 > BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 > 100) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 > 100) + Selected Partitions: 2..4 +(5 rows) --1.1.3.4 >= BD(1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 >= 100) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 >= 100) + Selected Partitions: 2..4 +(5 rows) --1.1.3.5 > -BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>150; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 > 150) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 > 150) + Selected Partitions: 2..4 +(5 rows) --1.1.3.6 >= -BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=150; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 >= 150) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 >= 150) + Selected Partitions: 2..4 +(5 rows) --1.1.3.7 > BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>200; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 > 200) - Selected Partitions: 3..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 > 200) + Selected Partitions: 3..4 +(5 rows) --1.1.3.8 >= BD(N) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=200; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 >= 200) - Selected Partitions: 3..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 >= 200) + Selected Partitions: 3..4 +(5 rows) --1.1.3.11 > BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>500; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 > 500) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 > 500) + Selected Partitions: NONE +(5 rows) --1.1.3.12 >= BD(Z) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=500; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 >= 500) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 >= 500) + Selected Partitions: NONE +(5 rows) --1.1.5 IN (ArrayExpr) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1 IN (230,330,350); - QUERY PLAN ---------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (c1 = ANY ('{230,330,350}'::integer[])) - Selected Partitions: 3..4 -(6 rows) + QUERY PLAN +--------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (c1 = ANY ('{230,330,350}'::integer[])) + Selected Partitions: 3..4 +(5 rows) --1.2.1 ITEM(<) AND ITEM(<) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 AND t_pruning_datatype_int32.c1<250; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) AND (c1 < 250)) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) AND (c1 < 250)) + Selected Partitions: 1 +(3 rows) --1.2.2 ITEM(>) AND ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50 AND t_pruning_datatype_int32.c1>=150; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 50) AND (c1 >= 150)) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 50) AND (c1 >= 150)) + Selected Partitions: 2..4 +(5 rows) --1.2.2 ITEM(>) AND ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 AND t_pruning_datatype_int32.c1>=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 100) AND (c1 >= 100)) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 100) AND (c1 >= 100)) + Selected Partitions: 2..4 +(5 rows) --1.2.3 ITEM(>) AND ITEM(<) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 AND t_pruning_datatype_int32.c1>0; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) AND (c1 > 0)) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) AND (c1 > 0)) + Selected Partitions: 1 +(3 rows) --1.2.3 ITEM(>) AND ITEM(<) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<300; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 >= 100) AND (c1 < 300)) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 >= 100) AND (c1 < 300)) + Selected Partitions: 2..3 +(5 rows) --1.2.3 ITEM(>) AND ITEM(<) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<550; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 >= 100) AND (c1 < 550)) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 >= 100) AND (c1 < 550)) + Selected Partitions: 2..4 +(5 rows) --1.2.4 ITEM(>) AND ITEM(<) (NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 AND t_pruning_datatype_int32.c1>100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) AND (c1 > 100)) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) AND (c1 > 100)) + Selected Partitions: NONE +(5 rows) --1.2.4 ITEM(>) AND ITEM(<) (NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>250 AND t_pruning_datatype_int32.c1<50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 250) AND (c1 < 50)) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 250) AND (c1 < 50)) + Selected Partitions: NONE +(5 rows) --1.2.7 ITEM(=) AND ITEM(>) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 >= 100) AND (c1 = 100)) - Selected Partitions: 2 -(6 rows) + QUERY PLAN +-------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 >= 100) AND (c1 = 100)) + Selected Partitions: 2 +(3 rows) --1.2.10 ITEM(<) AND OTHER explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c4 IS NULL AND (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1100); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c4 IS NULL) AND (c1 > 300) AND (c1 < c2) AND ((c1 > 500) OR (c1 < 250)) AND ((c2 < c3) OR (c2 > 100))) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c4 IS NULL) AND (c1 > 300) AND (c1 < c2) AND ((c1 > 500) OR (c1 < 250)) AND ((c2 < c3) OR (c2 > 100))) + Selected Partitions: NONE +(5 rows) --1.3.1 ITEM(<) OR ITEM(<) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1<250; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) OR (c1 < 250)) - Selected Partitions: 1..3 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) OR (c1 < 250)) + Selected Partitions: 1..3 +(5 rows) --1.3.2 ITEM(>) OR ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50 OR t_pruning_datatype_int32.c1>=150; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 50) OR (c1 >= 150)) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 50) OR (c1 >= 150)) + Selected Partitions: 1..4 +(5 rows) --1.3.2 ITEM(>) OR ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 OR t_pruning_datatype_int32.c1>=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 100) OR (c1 >= 100)) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 100) OR (c1 >= 100)) + Selected Partitions: 2..4 +(5 rows) --1.3.3 ITEM(>) OR ITEM(<) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>0; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) OR (c1 > 0)) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) OR (c1 > 0)) + Selected Partitions: 1..4 +(5 rows) --1.3.3 ITEM(>) OR ITEM(<) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 OR t_pruning_datatype_int32.c1<200; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 >= 100) OR (c1 < 200)) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 >= 100) OR (c1 < 200)) + Selected Partitions: 1..4 +(5 rows) --1.3.4 ITEM(>) OR ITEM(<) (NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) OR (c1 > 100)) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) OR (c1 > 100)) + Selected Partitions: 1..4 +(5 rows) --1.3.4 ITEM(>) OR ITEM(<) (NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 500) OR (c1 < 250)) - Selected Partitions: 1..3 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 500) OR (c1 < 250)) + Selected Partitions: 1..3 +(5 rows) --1.3.4 ITEM(>) OR ITEM(<) (NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>250 OR t_pruning_datatype_int32.c1<50; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 250) OR (c1 < 50)) - Selected Partitions: 1,3..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 250) OR (c1 < 50)) + Selected Partitions: 1,3..4 +(5 rows) --1.3.7 ITEM(=) OR ITEM(>) (NOT NULL) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=100 OR t_pruning_datatype_int32.c1=100; - QUERY PLAN --------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 >= 100) OR (c1 = 100)) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 >= 100) OR (c1 = 100)) + Selected Partitions: 2..4 +(5 rows) --1.3.9 ITEM(<) OR OTHER explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c4 IS NULL OR (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1100); - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c4 IS NULL) OR (((c1 > 500) OR (c1 < 250)) AND (c1 > 300) AND (c1 < c2) AND ((c2 < c3) OR (c2 > 100)))) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c4 IS NULL) OR (((c1 > 500) OR (c1 < 250)) AND (c1 > 300) AND (c1 < c2) AND ((c2 < c3) OR (c2 > 100)))) + Selected Partitions: 1..4 +(5 rows) --1.4.1 ITEM(<) AND ITEM(<) AND ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 AND t_pruning_datatype_int32.c1<=500 AND t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<500; - QUERY PLAN ------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 100) AND (c1 <= 500) AND (c1 >= 100) AND (c1 < 500)) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 100) AND (c1 <= 500) AND (c1 >= 100) AND (c1 < 500)) + Selected Partitions: 2..4 +(5 rows) --1.4.1 ITEM(<) AND ITEM(<) AND ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>50 AND t_pruning_datatype_int32.c1>100 AND t_pruning_datatype_int32.c1>=100 AND t_pruning_datatype_int32.c1<250 AND t_pruning_datatype_int32.c1<=250 AND t_pruning_datatype_int32.c1=200; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 50) AND (c1 > 100) AND (c1 >= 100) AND (c1 < 250) AND (c1 <= 250) AND (c1 = 200)) - Selected Partitions: 3 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 50) AND (c1 > 100) AND (c1 >= 100) AND (c1 < 250) AND (c1 <= 250) AND (c1 = 200)) + Selected Partitions: 3 +(3 rows) --1.4.2 ITEM(>) AND ITEM(<) OR ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<170 AND ( t_pruning_datatype_int32.c1>600 OR t_pruning_datatype_int32.c1<150); - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 170) AND ((c1 > 600) OR (c1 < 150))) - Selected Partitions: 1..2 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 170) AND ((c1 > 600) OR (c1 < 150))) + Selected Partitions: 1..2 +(5 rows) --1.4.3 ITEM(>) OR ITEM(<) OR ITEM(>) OR ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>100 OR t_pruning_datatype_int32.c1<=300 OR t_pruning_datatype_int32.c1>=100 OR t_pruning_datatype_int32.c1<300; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 100) OR (c1 <= 300) OR (c1 >= 100) OR (c1 < 300)) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 100) OR (c1 <= 300) OR (c1 >= 100) OR (c1 < 300)) + Selected Partitions: 1..4 +(5 rows) --1.4.5 (ITEM(>) OR ITEM(<)) AND ITEM(<) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1<170 OR t_pruning_datatype_int32.c1<250) AND ( t_pruning_datatype_int32.c1>600 OR t_pruning_datatype_int32.c1<150); - QUERY PLAN ------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (((c1 < 170) OR (c1 < 250)) AND ((c1 > 600) OR (c1 < 150))) - Selected Partitions: 1..2 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (((c1 < 170) OR (c1 < 250)) AND ((c1 > 600) OR (c1 < 150))) + Selected Partitions: 1..2 +(5 rows) --1.4.2 ITEM(>) AND ITEM(<) OR ITEM(>) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>250 AND t_pruning_datatype_int32.c1<400; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 < 50) OR ((c1 > 250) AND (c1 < 400))) - Selected Partitions: 1,3..4 -(6 rows) + QUERY PLAN +------------------------------------------------------------ + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 < 50) OR ((c1 > 250) AND (c1 < 400))) + Selected Partitions: 1,3..4 +(5 rows) --1.4.4 ITEM(>) AND ITEM(<) OR ITEM(>) AND ITEM(<) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=-100 AND t_pruning_datatype_int32.c1<50 OR t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1,4 +(5 rows) --1.4.4 ITEM(>) AND ITEM(<) OR ITEM(>) AND ITEM(<) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where t_pruning_datatype_int32.c1>=-100 AND t_pruning_datatype_int32.c1<=100 OR t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1<700; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: (((c1 >= (-100)) AND (c1 <= 100)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: (((c1 >= (-100)) AND (c1 <= 100)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1..2,4 +(5 rows) --1.4.6 (ITEM(>) OR ITEM(<)) AND ((ITEM(>) OR ITEM(<))) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1100) OR t_pruning_datatype_int32.c4 IS NULL; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((((c1 > 500) OR (c1 < 250)) AND (c1 > 300) AND (c1 < c2) AND ((c2 < c3) OR (c2 > 100))) OR (c4 IS NULL)) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((((c1 > 500) OR (c1 < 250)) AND (c1 > 300) AND (c1 < c2) AND ((c2 < c3) OR (c2 > 100))) OR (c4 IS NULL)) + Selected Partitions: 1..4 +(5 rows) --1.4.6 (ITEM(>) OR ITEM(<)) AND ((ITEM(>) OR ITEM(<))) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1100) AND t_pruning_datatype_int32.c4 IS NULL; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c4 IS NULL) AND (c1 > 300) AND (c1 < c2) AND ((c1 > 500) OR (c1 < 250)) AND ((c2 < c3) OR (c2 > 100))) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c4 IS NULL) AND (c1 > 300) AND (c1 < c2) AND ((c1 > 500) OR (c1 < 250)) AND ((c2 < c3) OR (c2 > 100))) + Selected Partitions: NONE +(5 rows) --1.4.8 composite explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c4 IS NULL) AND (t_pruning_datatype_int32.c2100); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c4 IS NULL) AND (c1 > 300) AND ((c1 > 500) OR (c1 < 250)) AND ((c2 < c3) OR (c2 > 100))) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c4 IS NULL) AND (c1 > 300) AND ((c1 > 500) OR (c1 < 250)) AND ((c2 < c3) OR (c2 > 100))) + Selected Partitions: NONE +(5 rows) --1.4.8 composite explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where (t_pruning_datatype_int32.c1>500 OR t_pruning_datatype_int32.c1<250) AND (t_pruning_datatype_int32.c1>300 AND t_pruning_datatype_int32.c1100); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Filter: ((c1 > 300) AND (c1 < c2) AND ((c4 IS NULL) OR (c2 > 100)) AND ((c1 > 500) OR (c1 < 250))) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Filter: ((c1 > 300) AND (c1 < c2) AND ((c4 IS NULL) OR (c2 > 100)) AND ((c1 > 500) OR (c1 < 250))) + Selected Partitions: NONE +(5 rows) --1.4.9 param(no pruning) set enable_hashjoin=off; @@ -900,21 +821,19 @@ set enable_material=off; create index t_pruning_datatype_int32_i on t_pruning_datatype_int32(c1) local; explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int32 where c2 in (select c1 from t_pruning_datatype_int32); - QUERY PLAN ------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Semi Join - -> Streaming(type: REDISTRIBUTE) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Only Scan using t_pruning_datatype_int32_i on t_pruning_datatype_int32 - Index Cond: (c1 = public.t_pruning_datatype_int32.c2) - Selected Partitions: 1..4 -(12 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------ + Nested Loop Semi Join + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Only Scan using t_pruning_datatype_int32_i on t_pruning_datatype_int32 + Index Cond: (c1 = public.t_pruning_datatype_int32.c2) + Selected Partitions: 1..4 +(10 rows) drop index t_pruning_datatype_int32_i; reset enable_hashjoin; @@ -930,29 +849,26 @@ select * from t_pruning_datatype_int32 t1, (select c4, 3 as "3" from t_pruning_datatype_int32) t3 ) t4 where t1.c1 = t4."3"; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) + QUERY PLAN +-------------------------------------------------------------------------- + Nested Loop -> Hash Join - Hash Cond: ((3) = t1.c1) - -> Nested Loop Left Join + Hash Cond: (t1.c1 = (3)) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 t1 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on t_pruning_datatype_int32 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 - Selected Partitions: 1..4 - -> Hash - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_datatype_int32 t1 - Selected Partitions: 1..4 -(20 rows) + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_datatype_int32 + Selected Partitions: 1..4 +(17 rows) --4 datatype --4.1 int @@ -966,27 +882,25 @@ partition by range(c1) partition p4 values less than(500)); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int16 where c1>=-100 AND c1<50 OR c1>300 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int16 - Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int16 + Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int16 where c1 IN (150,250,500,600); - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int16 - Filter: (c1 = ANY ('{150,250,500,600}'::integer[])) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int16 + Filter: (c1 = ANY ('{150,250,500,600}'::integer[])) + Selected Partitions: 2..3 +(5 rows) --4.3 integer --Done @@ -1000,27 +914,25 @@ partition by range(c1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int64 where c1>=-100 AND c1<50 OR c1>300 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int64 - Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int64 + Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_int64 where c1 IN (150,250,500,600); - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_int64 - Filter: (c1 = ANY ('{150,250,500,600}'::bigint[])) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +------------------------------------------------------------ + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_int64 + Filter: (c1 = ANY ('{150,250,500,600}'::bigint[])) + Selected Partitions: 2..3 +(5 rows) --4.5 decimal create table t_pruning_datatype_decimal(c1 decimal,c2 int,c3 int,c4 text) @@ -1031,39 +943,36 @@ partition by range(c1) partition p4 values less than(500.55)); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_decimal where c1>=-100.11 AND c1<50.0 OR c1>300.33 AND c1<700; - QUERY PLAN --------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_decimal - Filter: (((c1 >= (-100.11)) AND (c1 < 50.0)) OR ((c1 > 300.33) AND (c1 < 700::numeric))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_decimal + Filter: (((c1 >= (-100.11)) AND (c1 < 50.0)) OR ((c1 > 300.33) AND (c1 < 700::numeric))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_decimal where c1 IN (100.11,250.0, 300.33,700); - QUERY PLAN ---------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_decimal - Filter: (c1 = ANY ('{100.11,250.0,300.33,700}'::numeric[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_decimal + Filter: (c1 = ANY ('{100.11,250.0,300.33,700}'::numeric[])) + Selected Partitions: 2..4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_decimal where c1 IN (150,250,500,600); - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_decimal - Filter: (c1 = ANY ('{150,250,500,600}'::numeric[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_decimal + Filter: (c1 = ANY ('{150,250,500,600}'::numeric[])) + Selected Partitions: 2..4 +(5 rows) --4.6 numeric create table t_pruning_datatype_numeric(c1 numeric,c2 int,c3 int,c4 text) @@ -1074,39 +983,36 @@ partition by range(c1) partition p4 values less than(500.55)); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_numeric where c1>=-100.11 AND c1<50.0 OR c1>300.33 AND c1<700; - QUERY PLAN --------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_numeric - Filter: (((c1 >= (-100.11)) AND (c1 < 50.0)) OR ((c1 > 300.33) AND (c1 < 700::numeric))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_numeric + Filter: (((c1 >= (-100.11)) AND (c1 < 50.0)) OR ((c1 > 300.33) AND (c1 < 700::numeric))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_numeric where c1 IN (100.11,250.0, 300.33,700); - QUERY PLAN ---------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_numeric - Filter: (c1 = ANY ('{100.11,250.0,300.33,700}'::numeric[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_numeric + Filter: (c1 = ANY ('{100.11,250.0,300.33,700}'::numeric[])) + Selected Partitions: 2..4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_numeric where c1 IN (150,250,500,600); - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_numeric - Filter: (c1 = ANY ('{150,250,500,600}'::numeric[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_numeric + Filter: (c1 = ANY ('{150,250,500,600}'::numeric[])) + Selected Partitions: 2..4 +(5 rows) drop table t_pruning_datatype_int32; drop table t_pruning_datatype_int16; diff --git a/src/test/regress/expected/hw_partition_pruning_2.out b/src/test/regress/expected/hw_partition_pruning_2.out index d71dfa79b..f48dde121 100644 --- a/src/test/regress/expected/hw_partition_pruning_2.out +++ b/src/test/regress/expected/hw_partition_pruning_2.out @@ -7,63 +7,54 @@ partition by range(c1) partition p4 values less than(500.55)); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_real where c1>=-100.11 AND c1<50.0 OR c1>300.33 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_real - Filter: (((c1 >= (-100.11)::double precision) AND (c1 < 50::double precision)) OR ((c1 > 300.33::double precision) AND (c1 < 700::double precision))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_real + Filter: (((c1 >= (-100.11)::double precision) AND (c1 < 50::double precision)) OR ((c1 > 300.33::double precision) AND (c1 < 700::double precision))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_real where c1 = 100.11; - QUERY PLAN -------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_real - Filter: (c1 = 100.11::double precision) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_real + Filter: (c1 = 100.11::double precision) + Selected Partitions: 1 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_real where c1 = 100.11::real; - QUERY PLAN -------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_real - Filter: (c1 = 100.11::real) - Selected Partitions: 2 -(6 rows) + QUERY PLAN +------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_real + Filter: (c1 = 100.11::real) + Selected Partitions: 2 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_real where c1 IN (100.11,250.0, 300.33,700); - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_real - Filter: (c1 = ANY ('{100.11,250,300.33,700}'::double precision[])) - Selected Partitions: 1,3..4 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_real + Filter: (c1 = ANY ('{100.11,250,300.33,700}'::double precision[])) + Selected Partitions: 1,3..4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_real where c1 IN (150,250,500,600); - QUERY PLAN ----------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_real - Filter: (c1 = ANY ('{150,250,500,600}'::real[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +---------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_real + Filter: (c1 = ANY ('{150,250,500,600}'::real[])) + Selected Partitions: 2..4 +(5 rows) --4.8 double precision create table t_pruning_datatype_double(c1 double precision,c2 int,c3 int,c4 text) @@ -75,39 +66,36 @@ partition by range(c1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_double where c1>=-100.11 AND c1<50.0 OR c1>300.33 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_double - Filter: (((c1 >= (-100.11)::double precision) AND (c1 < 50::double precision)) OR ((c1 > 300.33::double precision) AND (c1 < 700::double precision))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_double + Filter: (((c1 >= (-100.11)::double precision) AND (c1 < 50::double precision)) OR ((c1 > 300.33::double precision) AND (c1 < 700::double precision))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_double where c1 IN (100.11,250.0, 300.33,700); - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_double - Filter: (c1 = ANY ('{100.11,250,300.33,700}'::double precision[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_double + Filter: (c1 = ANY ('{100.11,250,300.33,700}'::double precision[])) + Selected Partitions: 2..4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_double where c1 IN (150,250,500,600); - QUERY PLAN ----------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_double - Filter: (c1 = ANY ('{150,250,500,600}'::double precision[])) - Selected Partitions: 2..4 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_double + Filter: (c1 = ANY ('{150,250,500,600}'::double precision[])) + Selected Partitions: 2..4 +(5 rows) --4.9 smallserial create table t_pruning_datatype_smallserial(c1 smallserial,c2 int,c3 int,c4 text) @@ -119,39 +107,36 @@ partition by range(c1) NOTICE: CREATE TABLE will create implicit sequence "t_pruning_datatype_smallserial_c1_seq" for serial column "t_pruning_datatype_smallserial.c1" explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_smallserial where c1>=-100 AND c1<50 OR c1>300 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_smallserial - Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_smallserial + Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_smallserial where c1 IN (150,250,500,600); - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_smallserial - Filter: (c1 = ANY ('{150,250,500,600}'::integer[])) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +-------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_smallserial + Filter: (c1 = ANY ('{150,250,500,600}'::integer[])) + Selected Partitions: 2..3 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_smallserial where c1 IN (150,250,500,null); - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_smallserial - Filter: (c1 = ANY ('{150,250,500,NULL}'::integer[])) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +-------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_smallserial + Filter: (c1 = ANY ('{150,250,500,NULL}'::integer[])) + Selected Partitions: 2..3 +(5 rows) --4.10 serial create table t_pruning_datatype_serial(c1 serial,c2 int,c3 int,c4 text) @@ -163,27 +148,25 @@ partition by range(c1) NOTICE: CREATE TABLE will create implicit sequence "t_pruning_datatype_serial_c1_seq" for serial column "t_pruning_datatype_serial.c1" explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_serial where c1>=-100 AND c1<50 OR c1>300 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_serial - Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_serial + Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_serial where c1 IN (150,250,500,600); - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_serial - Filter: (c1 = ANY ('{150,250,500,600}'::integer[])) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_serial + Filter: (c1 = ANY ('{150,250,500,600}'::integer[])) + Selected Partitions: 2..3 +(5 rows) --4.11 bigserial create table t_pruning_datatype_bigserial(c1 bigserial,c2 int,c3 int,c4 text) @@ -195,27 +178,25 @@ partition by range(c1) NOTICE: CREATE TABLE will create implicit sequence "t_pruning_datatype_bigserial_c1_seq" for serial column "t_pruning_datatype_bigserial.c1" explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_bigserial where c1>=-100 AND c1<50 OR c1>300 AND c1<700; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_bigserial - Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_bigserial + Filter: (((c1 >= (-100)) AND (c1 < 50)) OR ((c1 > 300) AND (c1 < 700))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_bigserial where c1 IN (150,250,500,600); - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_bigserial - Filter: (c1 = ANY ('{150,250,500,600}'::bigint[])) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +------------------------------------------------------------ + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_bigserial + Filter: (c1 = ANY ('{150,250,500,600}'::bigint[])) + Selected Partitions: 2..3 +(5 rows) --4.12 character varying(n), varchar(n) create table t_pruning_datatype_varchar(c1 varchar,c2 int,c3 int,c4 text) @@ -226,27 +207,25 @@ partition by range(c1) partition p4 values less than(MAXVALUE)); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_varchar where c1>='abcd' AND c1<'cdef' OR c1>'qqqqqqqqqqqq' AND c1<'yyyyy'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_varchar - Filter: ((((c1)::text >= 'abcd'::text) AND ((c1)::text < 'cdef'::text)) OR (((c1)::text > 'qqqqqqqqqqqq'::text) AND ((c1)::text < 'yyyyy'::text))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_varchar + Filter: ((((c1)::text >= 'abcd'::text) AND ((c1)::text < 'cdef'::text)) OR (((c1)::text > 'qqqqqqqqqqqq'::text) AND ((c1)::text < 'yyyyy'::text))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_varchar where c1 IN ('abcd','dabc','hhcdddda','zzzz'); - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_varchar - Filter: ((c1)::text = ANY ('{abcd,dabc,hhcdddda,zzzz}'::text[])) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_varchar + Filter: ((c1)::text = ANY ('{abcd,dabc,hhcdddda,zzzz}'::text[])) + Selected Partitions: 1..2,4 +(5 rows) --4.13 character(n), char(n) create table t_pruning_datatype_charn(c1 char(40),c2 int,c3 int,c4 text) @@ -258,39 +237,36 @@ partition by range(c1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_charn where c1>='abcd' AND c1<'cdef' OR c1>'qqqqqqqqqqqq' AND c1<'yyyyy'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_charn - Filter: (((c1 >= 'abcd'::bpchar) AND (c1 < 'cdef'::bpchar)) OR ((c1 > 'qqqqqqqqqqqq'::bpchar) AND (c1 < 'yyyyy'::bpchar))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_charn + Filter: (((c1 >= 'abcd'::bpchar) AND (c1 < 'cdef'::bpchar)) OR ((c1 > 'qqqqqqqqqqqq'::bpchar) AND (c1 < 'yyyyy'::bpchar))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_charn where c1 IN ('abcd','dabc','hhcdddda','zzzz'); - QUERY PLAN --------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_charn - Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,zzzz}'::bpchar[])) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_charn + Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,zzzz}'::bpchar[])) + Selected Partitions: 1..2,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_charn where c1 IN ('abcd','dabc','hhcdddda',null); - QUERY PLAN --------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_charn - Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,NULL}'::bpchar[])) - Selected Partitions: 1..2 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_charn + Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,NULL}'::bpchar[])) + Selected Partitions: 1..2 +(5 rows) --4.14 character.char create table t_pruning_datatype_char(c1 char,c2 int,c3 int,c4 text) @@ -302,27 +278,25 @@ partition by range(c1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_char where c1>='b' AND c1<'h' OR c1>'q' AND c1<'y'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_char - Filter: (((c1 >= 'b'::bpchar) AND (c1 < 'h'::bpchar)) OR ((c1 > 'q'::bpchar) AND (c1 < 'y'::bpchar))) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_char + Filter: (((c1 >= 'b'::bpchar) AND (c1 < 'h'::bpchar)) OR ((c1 > 'q'::bpchar) AND (c1 < 'y'::bpchar))) + Selected Partitions: 1..2,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_char where c1 IN ('a','d','h','z'); - QUERY PLAN -------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_char - Filter: (c1 = ANY ('{a,d,h,z}'::bpchar[])) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_char + Filter: (c1 = ANY ('{a,d,h,z}'::bpchar[])) + Selected Partitions: 1..2,4 +(5 rows) --4.15 text create table t_pruning_datatype_text(c1 text,c2 int,c3 int,c4 text) @@ -334,27 +308,25 @@ partition by range(c1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_text where c1>='abcd' AND c1<'cdef' OR c1>'qqqqqqqqqqqq' AND c1<'yyyyy'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_text - Filter: (((c1 >= 'abcd'::text) AND (c1 < 'cdef'::text)) OR ((c1 > 'qqqqqqqqqqqq'::text) AND (c1 < 'yyyyy'::text))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_text + Filter: (((c1 >= 'abcd'::text) AND (c1 < 'cdef'::text)) OR ((c1 > 'qqqqqqqqqqqq'::text) AND (c1 < 'yyyyy'::text))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_text where c1 IN ('abcd','dabc','hhcdddda','zzzz'); - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_text - Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,zzzz}'::text[])) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +------------------------------------------------------------------ + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_text + Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,zzzz}'::text[])) + Selected Partitions: 1..2,4 +(5 rows) --4.16 nvarchar2 --4.17 name @@ -367,27 +339,25 @@ partition by range(c1) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_name where c1>='abcd' AND c1<'cdef' OR c1>'qqqqqqqqqqqqq' AND c1<'yyyyy'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_name - Filter: (((c1 >= 'abcd'::name) AND (c1 < 'cdef'::name)) OR ((c1 > 'qqqqqqqqqqqqq'::name) AND (c1 < 'yyyyy'::name))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_name + Filter: (((c1 >= 'abcd'::name) AND (c1 < 'cdef'::name)) OR ((c1 > 'qqqqqqqqqqqqq'::name) AND (c1 < 'yyyyy'::name))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_name where c1 IN ('abcd','dabc','hhcdddda','zzzz'); - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_name - Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,zzzz}'::name[])) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +------------------------------------------------------------------ + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_name + Filter: (c1 = ANY ('{abcd,dabc,hhcdddda,zzzz}'::name[])) + Selected Partitions: 1..2,4 +(5 rows) --4.18 timestamp [ (p) ] [ without time zone ] create table t_pruning_datatype_timestamp(c1 timestamp,c2 int,c3 int,c4 text) @@ -398,27 +368,25 @@ partition by range(c1) partition p4 values less than('2013-12-26')); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_timestamp where c1>=to_timestamp('2012-05-12','YYYY-MM-DD') AND c1<'2012-11-12' OR c1>'2013-06-12' AND c1<'2014-09-08'; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_timestamp - Filter: (((c1 >= to_timestamp('2012-05-12'::text, 'YYYY-MM-DD'::text)) AND (c1 < 'Mon Nov 12 00:00:00 2012'::timestamp without time zone)) OR ((c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone) AND (c1 < 'Mon Sep 08 00:00:00 2014'::timestamp without time zone))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_timestamp + Filter: (((c1 >= to_timestamp('2012-05-12'::text, 'YYYY-MM-DD'::text)) AND (c1 < 'Mon Nov 12 00:00:00 2012'::timestamp without time zone)) OR ((c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone) AND (c1 < 'Mon Sep 08 00:00:00 2014'::timestamp without time zone))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_timestamp where c1 IN ('2012-05-12','2012-12-23') OR c1>'2013-06-12'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_timestamp - Filter: ((c1 = ANY ('{"Sat May 12 00:00:00 2012","Sun Dec 23 00:00:00 2012"}'::timestamp without time zone[])) OR (c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone)) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_timestamp + Filter: ((c1 = ANY ('{"Sat May 12 00:00:00 2012","Sun Dec 23 00:00:00 2012"}'::timestamp without time zone[])) OR (c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone)) + Selected Partitions: 1..2,4 +(5 rows) --4.19 timestamp [ (p) ] with time zone --4.20 date @@ -430,39 +398,34 @@ partition by range(c1) partition p4 values less than('2013-12-26')); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_date where c1>=to_date('2012-05-12','YYYY-MM-DD') AND c1<'2012-11-12' OR c1>'2013-06-12' AND c1<'2014-09-08'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on t_pruning_datatype_date - Filter: (((c1 >= to_date('2012-05-12'::text, 'YYYY-MM-DD'::text)) AND (c1 < 'Mon Nov 12 00:00:00 2012'::timestamp without time zone)) OR ((c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone) AND (c1 < 'Mon Sep 08 00:00:00 2014'::timestamp without time zone))) - Selected Partitions: 1,4 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on t_pruning_datatype_date + Filter: (((c1 >= to_date('2012-05-12'::text, 'YYYY-MM-DD'::text)) AND (c1 < 'Mon Nov 12 00:00:00 2012'::timestamp without time zone)) OR ((c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone) AND (c1 < 'Mon Sep 08 00:00:00 2014'::timestamp without time zone))) + Selected Partitions: 1,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_date where c1 IN (to_date('2012-05-12','YYYY-MM-DD'),'2012-12-23') OR c1>'2013-06-12'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_datatype_date - Filter: ((c1 = ANY (ARRAY[to_date('2012-05-12'::text, 'YYYY-MM-DD'::text), 'Sun Dec 23 00:00:00 2012'::timestamp without time zone])) OR (c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone)) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_datatype_date + Filter: ((c1 = ANY (ARRAY[to_date('2012-05-12'::text, 'YYYY-MM-DD'::text), 'Sun Dec 23 00:00:00 2012'::timestamp without time zone])) OR (c1 > 'Wed Jun 12 00:00:00 2013'::timestamp without time zone)) + Selected Partitions: 1..2,4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_datatype_date where c1 = to_date('2012-05-12','YYYY-MM-DD')::text; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_datatype_date - Filter: (c1 = ((to_date('2012-05-12'::text, 'YYYY-MM-DD'::text))::text)::timestamp without time zone) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------- + Partitioned Seq Scan on t_pruning_datatype_date + Filter: (c1 = ((to_date('2012-05-12'::text, 'YYYY-MM-DD'::text))::text)::timestamp without time zone) + Selected Partitions: 1 +(3 rows) drop table t_pruning_datatype_real; drop table t_pruning_datatype_double; @@ -495,51 +458,43 @@ partition by range (C_INT,C_NUMERIC,C_VARCHAR_3,C_TS_WITHOUT) ); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) SELECT * FROM pruning_partition_table_000 WHERE C_INT>=int4(10.5) and C_INT<=50; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on pruning_partition_table_000 - Filter: ((c_int >= 11) AND (c_int <= 50)) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +----------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on pruning_partition_table_000 + Filter: ((c_int >= 11) AND (c_int <= 50)) + Selected Partitions: 2..3 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) SELECT * FROM pruning_partition_table_000 WHERE C_INT=int4(12.33); - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on pruning_partition_table_000 - Filter: (c_int = 12) - Selected Partitions: 2 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partitioned Seq Scan on pruning_partition_table_000 + Filter: (c_int = 12) + Selected Partitions: 2 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) SELECT * FROM pruning_partition_table_000 WHERE C_INT<10; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on pruning_partition_table_000 - Filter: (c_int < 10) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partitioned Seq Scan on pruning_partition_table_000 + Filter: (c_int < 10) + Selected Partitions: 1 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) SELECT * FROM pruning_partition_table_000 WHERE C_INT>10; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on pruning_partition_table_000 - Filter: (c_int > 10) - Selected Partitions: 2..3 -(6 rows) + QUERY PLAN +----------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on pruning_partition_table_000 + Filter: (c_int > 10) + Selected Partitions: 2..3 +(5 rows) drop table pruning_partition_table_000; create table t_pruning_TESTTABLE_1(c1 int,c2 text) @@ -551,65 +506,52 @@ partition by range(c1) ); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_1 where c1 IS NULL; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on t_pruning_testtable_1 - Filter: (c1 IS NULL) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on t_pruning_testtable_1 + Filter: (c1 IS NULL) + Selected Partitions: NONE +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_1 where c1 IS NOT NULL; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_testtable_1 - Filter: (c1 IS NOT NULL) - Selected Partitions: 1..3 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_testtable_1 + Filter: (c1 IS NOT NULL) + Selected Partitions: 1..3 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_1 where c1=null; - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Result - One-Time Filter: NULL::boolean - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_testtable_1 - Selected Partitions: 1..3 -(7 rows) + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_1 where c2=null; - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Result - One-Time Filter: NULL::boolean - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_testtable_1 - Selected Partitions: 1..3 -(7 rows) + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_1 where c2 IS NULL; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_testtable_1 - Filter: (c2 IS NULL) - Selected Partitions: 1..3 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_testtable_1 + Filter: (c2 IS NULL) + Selected Partitions: 1..3 +(5 rows) drop table t_pruning_TESTTABLE_1; create table t_pruning_TESTTABLE_2(c1 int,c2 text) @@ -622,102 +564,78 @@ partition by range(c1) ); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c1 IS NULL; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Filter: (c1 IS NULL) - Selected Partitions: 4 -(6 rows) + QUERY PLAN +----------------------------------------------- + Partitioned Seq Scan on t_pruning_testtable_2 + Filter: (c1 IS NULL) + Selected Partitions: 4 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c1 IS NOT NULL; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Filter: (c1 IS NOT NULL) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_testtable_2 + Filter: (c1 IS NOT NULL) + Selected Partitions: 1..4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c1=null; - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Result - One-Time Filter: NULL::boolean - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Selected Partitions: 1..4 -(7 rows) + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where null=c1; - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Result - One-Time Filter: NULL::boolean - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Selected Partitions: 1..4 -(7 rows) + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c2=null; - QUERY PLAN ------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Result - One-Time Filter: NULL::boolean - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Selected Partitions: 1..4 -(7 rows) + QUERY PLAN +-------------------------- + Result + One-Time Filter: false +(2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c2 IS NULL; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Filter: (c2 IS NULL) - Selected Partitions: 1..4 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t_pruning_testtable_2 + Filter: (c2 IS NULL) + Selected Partitions: 1..4 +(5 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c1 IS NULL and c1>150; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Filter: ((c1 IS NULL) AND (c1 > 150)) - Selected Partitions: 4 -(6 rows) + QUERY PLAN +----------------------------------------------- + Partitioned Seq Scan on t_pruning_testtable_2 + Filter: ((c1 IS NULL) AND (c1 > 150)) + Selected Partitions: 4 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from t_pruning_TESTTABLE_2 where c1 IS NULL OR c1<150; - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on t_pruning_testtable_2 - Filter: ((c1 IS NULL) OR (c1 < 150)) - Selected Partitions: 1..2,4 -(6 rows) + QUERY PLAN +----------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on t_pruning_testtable_2 + Filter: ((c1 IS NULL) OR (c1 < 150)) + Selected Partitions: 1..2,4 +(5 rows) drop table t_pruning_TESTTABLE_2; -- where condition has function @@ -783,31 +701,20 @@ partition part1511 values less than ('2015-11-01 00:00:00'), partition part1512 values less than ('2015-12-01 00:00:00'), partition part1601 values less than ('2016-01-01 00:00:00') ); +ERROR: Un-support feature +DETAIL: The distributed capability is not supported currently. explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from wb_swry where swkssj >= to_date('2012-01-01 11:12:57', 'yyyy-mm-dd hh24:mi:ss') AND swkssj <= to_date('2012-01-31 11:13:02','yyyy-mm-dd hh24:mi:ss'); - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on wb_swry - Filter: ((swkssj >= to_date('2012-01-01 11:12:57'::text, 'yyyy-mm-dd hh24:mi:ss'::text)) AND (swkssj <= to_date('2012-01-31 11:13:02'::text, 'yyyy-mm-dd hh24:mi:ss'::text))) - Selected Partitions: 1 -(6 rows) - +ERROR: relation "wb_swry" does not exist on datanode1 +LINE 2: select * from wb_swry where swkssj >= to_date('2012-01-01 11... + ^ explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from wb_swry where swkssj >= '2012-01-01 11:12:57' AND swkssj <= '2012-01-31 11:13:02'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on wb_swry - Filter: ((swkssj >= 'Sun Jan 01 11:12:57 2012'::timestamp without time zone) AND (swkssj <= 'Tue Jan 31 11:13:02 2012'::timestamp without time zone)) - Selected Partitions: 1 -(6 rows) - +ERROR: relation "wb_swry" does not exist on datanode1 +LINE 2: select * from wb_swry where swkssj >= '2012-01-01 11:12:57' ... + ^ drop table wb_swry; +ERROR: table "wb_swry" does not exist -- where condition is false create table test_where_condition_is_false (a int) partition by range (a) @@ -818,88 +725,76 @@ partition by range (a) ); explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on test_where_condition_is_false - Selected Partitions: 1..3 -(5 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on test_where_condition_is_false + Selected Partitions: 1..3 +(4 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where 1=1; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on test_where_condition_is_false - Selected Partitions: 1..3 -(5 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on test_where_condition_is_false + Selected Partitions: 1..3 +(4 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where 1=4; ---?.* ---?.* + QUERY PLAN +-------------------------- Result One-Time Filter: false (2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where a<10; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on test_where_condition_is_false - Filter: (a < 10) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +------------------------------------------------------- + Partitioned Seq Scan on test_where_condition_is_false + Filter: (a < 10) + Selected Partitions: 1 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where a<10 and 1=1; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on test_where_condition_is_false - Filter: (a < 10) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +------------------------------------------------------- + Partitioned Seq Scan on test_where_condition_is_false + Filter: (a < 10) + Selected Partitions: 1 +(3 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where a<10 and 1=4; ---?.* ---?.* + QUERY PLAN +-------------------------- Result One-Time Filter: false (2 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where a<10 or 1=1; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on test_where_condition_is_false - Selected Partitions: 1..3 -(5 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on test_where_condition_is_false + Selected Partitions: 1..3 +(4 rows) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from test_where_condition_is_false where a<10 or 1=4; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on test_where_condition_is_false - Filter: (a < 10) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +------------------------------------------------------- + Partitioned Seq Scan on test_where_condition_is_false + Filter: (a < 10) + Selected Partitions: 1 +(3 rows) drop table test_where_condition_is_false; --create table partition_pruning_f2(f1 int)compress partition by range(f1) interval (1) diff --git a/src/test/regress/expected/hw_partition_pruning_multikey.out b/src/test/regress/expected/hw_partition_pruning_multikey.out index 3455eae35..665d8d2ba 100644 --- a/src/test/regress/expected/hw_partition_pruning_multikey.out +++ b/src/test/regress/expected/hw_partition_pruning_multikey.out @@ -235,14 +235,13 @@ partition by range(c1,c2,c3,c4) --expect:1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Selected Partitions: 1..96 -(5 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Selected Partitions: 1..96 +(4 rows) --3.1 expression(c1) --3.1.1 ITEM @@ -250,589 +249,537 @@ select * from partition_pruning_multikey_t1; --expect: 1 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2002-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------- + Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) + Selected Partitions: 1 +(3 rows) --3.1.1.2 <= -BD(1) --expect: 1 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2002-10-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 <= 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------- + Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 <= 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) + Selected Partitions: 1 +(3 rows) --3.1.1.3 < BD(1) --expect: 1 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-01-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------- + Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1 +(3 rows) --3.1.1.4 <= BD(1) --expect: 1-28 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-01-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 <= 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..28 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 <= 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..28 +(5 rows) --3.1.1.5 < -BD(N) --expect: 1-50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-06-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..50 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..50 +(5 rows) --3.1.1.6 <= -BD(N) --expect: 1-50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-06-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 <= 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..50 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 <= 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..50 +(5 rows) --3.1.1.7 < BD(N) --expect: 1-50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-07-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..50 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..50 +(5 rows) --3.1.1.8 <= BD(N) --expect: 1-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-07-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 69 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..69 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 69 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..69 +(5 rows) --3.1.1.9 < -BD(Z) --expect: 1-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-09-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 69 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..69 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 69 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..69 +(5 rows) --3.1.1.10 <= -BD(Z) --expect: 1-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-09-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 69 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 <= 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..69 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 69 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 <= 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..69 +(5 rows) --3.1.1.11 < BD(Z) --expect: 1-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 69 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..69 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 69 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..69 +(5 rows) --3.1.1.12 <= BD(Z) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-10-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 <= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 <= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..96 +(5 rows) --3.1.1.13 < +BD(Z) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2004-01-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 < 'Thu Jan 01 00:00:00 2004'::timestamp without time zone) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 < 'Thu Jan 01 00:00:00 2004'::timestamp without time zone) + Selected Partitions: 1..96 +(5 rows) --3.1.1.14 > -BD(1) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2002-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 > 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 > 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) + Selected Partitions: 1..96 +(5 rows) --3.1.1.15 >= -BD(1) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2002-10-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 >= 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 >= 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) + Selected Partitions: 1..96 +(5 rows) --3.1.1.16 > BD(1) --expect: 28-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-01-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 69 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 > 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 28..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 69 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 > 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 28..96 +(5 rows) --3.1.1.17 >= BD(1) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-01-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 >= 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 >= 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..96 +(5 rows) --3.1.1.18 > -BD(N) --expect: 50-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-06-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 47 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 > 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 50..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 47 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 > 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 50..96 +(5 rows) --3.1.1.19 >= -BD(N) --expect: 50-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-06-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 47 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 >= 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 50..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 47 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 >= 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 50..96 +(5 rows) --3.1.1.20 > BD(N) --expect: 69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-07-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 > 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 69..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 > 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 69..96 +(5 rows) --3.1.1.21 >= BD(N) --expect: 50-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 47 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 50..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 47 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 50..96 +(5 rows) --3.1.1.22 > BD(Z) --expect: NONE explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 > 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 > 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: NONE +(5 rows) --3.1.1.23 >= BD(Z) --expect: 69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00'; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 69..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------- + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 69..96 +(5 rows) --3.1.1.24 > +BD(Z) --expect: NONE explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2004-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 > 'Fri Oct 01 00:00:00 2004'::timestamp without time zone) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 > 'Fri Oct 01 00:00:00 2004'::timestamp without time zone) + Selected Partitions: NONE +(5 rows) --3.1.1.25 = -BD(1) --expect: 1 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2002-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 = 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) - Selected Partitions: 1 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------- + Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 = 'Tue Oct 01 00:00:00 2002'::timestamp without time zone) + Selected Partitions: 1 +(3 rows) --3.1.1.26 = BD(1) --expect: 1-28 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-01-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 = 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 1..28 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 = 'Wed Jan 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 1..28 +(5 rows) --3.1.1.27 = -BD(N) --expect: 50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-06-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 = 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 50 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------- + Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 = 'Sun Jun 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 50 +(3 rows) --3.1.1.28 = BD(N) --expect: 50-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-07-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 20 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 = 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 50..69 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 20 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 = 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 50..69 +(5 rows) --3.1.1.29 = BD(Z) --expect: 69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-10-01 00:00:00'; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c1 = 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) - Selected Partitions: 69..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c1 = 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) + Selected Partitions: 69..96 +(5 rows) --3.1.2 composite --3.1.2.1 ITEM(<) AND ITEM(<) --expect: 1-50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-09-01 00:00:00' AND c1<='2003-04-01 00:00:00'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 < 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 1..50 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 < 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 1..50 +(5 rows) --3.1.2.2 ITEM(>) AND ITEM(>) --expect: 69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-09-01 00:00:00' AND c1>='2003-04-01 00:00:00'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 69..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 69..96 +(5 rows) --3.1.2.3 ITEM(>) AND ITEM(<) (NOT NULL) --expect: 28-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-09-01 00:00:00' AND c1>='2003-04-01 00:00:00'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 42 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 < 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 28..69 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 42 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 < 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 28..69 +(5 rows) --3.1.2.4 ITEM(>) AND ITEM(<) (NULL) --expect: NONE explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-09-01 00:00:00' AND c1<='2003-04-01 00:00:00'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: NONE -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) AND (c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: NONE +(5 rows) --expect: 28-50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c1<='2003-04-01 00:00:00'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 23 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 28..50 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 23 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 28..50 +(5 rows) --3.1.2.5 ITEM(=) OR ITEM(<) (NOT NULL) --expect: 1-50 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' OR c1<'2003-06-01 00:00:00'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) OR (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 1..50 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) OR (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 1..50 +(5 rows) --3.1.2.6 ITEM(=) OR ITEM(<) (NULL) --expect: 1-50,69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-09-01 00:00:00' OR c1<'2003-06-01 00:00:00'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 51 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) OR (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 1..50,69 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 51 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) OR (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 1..50,69 +(5 rows) --3.1.2.7 ITEM(=) OR ITEM(>) (NOT NULL) --expect: 50-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-09-01 00:00:00' OR c1>'2003-06-01 00:00:00'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 47 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) OR (c1 > 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 50..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 47 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) OR (c1 > 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 50..96 +(5 rows) --3.1.2.8 ITEM(=) OR ITEM(>) (NULL) --expect: 50,69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-09-01 00:00:00' OR c1='2003-06-01 00:00:00'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) OR (c1 = 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 50,69..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Mon Sep 01 00:00:00 2003'::timestamp without time zone) OR (c1 = 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 50,69..96 +(5 rows) --3.1.2.9 ITEM(<) OR ITEM(>) (NOT NULL) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-10-01 00:00:00' OR c1>'2003-06-01 00:00:00'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) OR (c1 > 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) OR (c1 > 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 1..96 +(5 rows) --3.1.2.10 ITEM(<) OR ITEM(>) (NULL) --expect: 1-50,69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' OR c1<'2003-06-01 00:00:00'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 78 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) OR (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 1..50,69..96 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 78 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) OR (c1 < 'Sun Jun 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 1..50,69..96 +(5 rows) --3.1.2.11 ITEM(<) AND OTHER --expect: 69-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' AND c5 IS NULL; - QUERY PLAN ----------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 28 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c5 IS NULL) AND (c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone)) - Selected Partitions: 69..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 28 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c5 IS NULL) AND (c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone)) + Selected Partitions: 69..96 +(5 rows) --3.1.2.12 NOKEY OR ITEM(>) --expect: 1-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' OR c5<100; - QUERY PLAN -------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 96 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) OR (c5 < 100)) - Selected Partitions: 1..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 96 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) OR (c5 < 100)) + Selected Partitions: 1..96 +(5 rows) --3.2 expression(c1,c2) --3.2.1 >/>= @@ -840,240 +787,223 @@ select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' OR c --expect: 28 / 37-50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-03-01 00:00:00' AND c2>'CCCC'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 45 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Sat Mar 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'CCCC'::text)) - Selected Partitions: 28,37..50,59..69,78..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 45 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Sat Mar 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'CCCC'::text)) + Selected Partitions: 28,37..50,59..69,78..96 +(5 rows) --expect: 50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'CCCC'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 31 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'CCCC'::text)) - Selected Partitions: 50,59..69,78..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 31 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'CCCC'::text)) + Selected Partitions: 50,59..69,78..96 +(5 rows) --expect: 50 / 59-69 / 87-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 22 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text)) - Selected Partitions: 50,59..69,87..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 22 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text)) + Selected Partitions: 50,59..69,87..96 +(5 rows) --3.2.1.2 ITEM(c1>=) AND ITEM(c2>) --expect: 43-50 / 59-69 / 87-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>'DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text)) - Selected Partitions: 43..50,59..69,87..96 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text)) + Selected Partitions: 43..50,59..69,87..96 +(5 rows) --3.2.1.3 ITEM(c1>) AND ITEM(c2>=) --expect: 50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>='DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 31 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text)) - Selected Partitions: 50,59..69,78..96 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 31 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text)) + Selected Partitions: 50,59..69,78..96 +(5 rows) --3.2.1.4 ITEM(c1>=) AND ITEM(c2>=) --expect: 37-50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 44 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text)) - Selected Partitions: 37..50,59..69,78..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 44 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text)) + Selected Partitions: 37..50,59..69,78..96 +(5 rows) --3.2.2 = --3.2.2.1 ITEM(c1=) AND ITEM(c2=) --expect: 37-43 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' AND c2='DDDD'; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 7 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 = 'DDDD'::text)) - Selected Partitions: 37..43 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 7 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 = 'DDDD'::text)) + Selected Partitions: 37..43 +(5 rows) --3.2.3 Partition Iterator - Iterations: 11 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text)) - Selected Partitions: 1..10,28 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 11 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text)) + Selected Partitions: 1..10,28 +(5 rows) --3.2.3.2 ITEM(c1<=) AND ITEM(c2<) --expect: 1-10 / 28-37 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<'DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 20 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text)) - Selected Partitions: 1..10,28..37 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 20 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text)) + Selected Partitions: 1..10,28..37 +(5 rows) --3.2.3.3 ITEM(c1<) AND ITEM(c2<=) --expect: 1-19 / 28 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<'2003-04-01 00:00:00' AND c2<='DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 20 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) - Selected Partitions: 1..19,28 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 20 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) + Selected Partitions: 1..19,28 +(5 rows) --3.2.3.4 ITEM(c1<=) AND ITEM(c2<=) --expect: 1-19 / 28-43 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 35 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) - Selected Partitions: 1..19,28..43 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 35 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) + Selected Partitions: 1..19,28..43 +(5 rows) --3.2.4 composite --3.2.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c1<) AND ITEM(c2<) --expect: 50 / 59 / 69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD' AND c1<'2003-10-01 00:00:00' AND c2<'HHHH'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'HHHH'::text)) - Selected Partitions: 50,59,69 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'HHHH'::text)) + Selected Partitions: 50,59,69 +(5 rows) --3.2.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c1<) AND ITEM(c2<=) --expect: 43-50 / 59-69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>'DDDD' AND c1<'2003-10-01 00:00:00' AND c2<='HHHH'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 19 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'HHHH'::text)) - Selected Partitions: 43..50,59..69 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 19 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'HHHH'::text)) + Selected Partitions: 43..50,59..69 +(5 rows) --3.2.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c1<=) AND ITEM(c2<=) --expect: 37-50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c1<='2003-10-01 00:00:00' AND c2<='HHHH'; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 44 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c1 <= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'HHHH'::text)) - Selected Partitions: 37..50,59..69,78..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 44 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c1 <= 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'HHHH'::text)) + Selected Partitions: 37..50,59..69,78..96 +(5 rows) --3.2.4.4 (ITEM(c1>) AND ITEM(c2>)) OR (ITEM(c1<) AND ITEM(c2<)) --expect: 1-10 / 28 / 69 / 96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where (c1>'2003-07-01 00:00:00' AND c2>'HHHH') OR (c1<'2003-04-01 00:00:00' AND c2<'DDDD'); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 13 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (((c1 > 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'HHHH'::text)) OR ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text))) - Selected Partitions: 1..10,28,69,96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 13 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (((c1 > 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'HHHH'::text)) OR ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text))) + Selected Partitions: 1..10,28,69,96 +(5 rows) --3.2.4.5 (ITEM(c1>=) AND ITEM(c2>)) OR (ITEM(c1<) AND ITEM(c2<=)) --expect: 1-19 / 28 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where (c1>='2003-07-01 00:00:00' AND c2>'BBBB') OR (c1<'2003-04-01 00:00:00' AND c2<='DDDD'); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'BBBB'::text)) OR ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text))) - Selected Partitions: 1..19,28,59..69,78..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'BBBB'::text)) OR ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text))) + Selected Partitions: 1..19,28,59..69,78..96 +(5 rows) --3.2.4.6 (ITEM(c1>=) AND ITEM(c2>=)) OR (ITEM(c1<=) AND ITEM(c2<=)) --expect: 1-19 / 28-43 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where (c1>='2003-07-01 00:00:00' AND c2>='BBBB') OR (c1<='2003-04-01 00:00:00' AND c2<='DDDD'); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 65 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'BBBB'::text)) OR ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text))) - Selected Partitions: 1..19,28..43,59..69,78..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 65 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'BBBB'::text)) OR ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text))) + Selected Partitions: 1..19,28..43,59..69,78..96 +(5 rows) --3.3 expression(c1,c2,c3) --3.3.1 >/>= @@ -1081,87 +1011,81 @@ select * from partition_pruning_multikey_t1 where (c1>='2003-07-01 00:00:00' AND --expect: 50 / 59-69 / 87-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD' AND c3>50.0; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 22 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c3 > 50::double precision)) - Selected Partitions: 50,59..69,87..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 22 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c3 > 50::double precision)) + Selected Partitions: 50,59..69,87..96 +(5 rows) --3.3.1.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) --expect: 43-50 / 59-69 / 87-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>'DDDD' AND c3>50.0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c3 > 50::double precision)) - Selected Partitions: 43..50,59..69,87..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c3 > 50::double precision)) + Selected Partitions: 43..50,59..69,87..96 +(5 rows) --3.3.1.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>) --expect: 37 / 40-43 / 46-50 / 59 / 62-69 / 78 / 81-87 / 90-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>100.0; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 34 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 > 100::double precision)) - Selected Partitions: 37,40..43,46..50,59,62..69,78,81..87,90..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 34 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 > 100::double precision)) + Selected Partitions: 37,40..43,46..50,59,62..69,78,81..87,90..96 +(5 rows) --3.3.1.4 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) --expect: 37-50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 44 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision)) - Selected Partitions: 37..50,59..69,78..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 44 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision)) + Selected Partitions: 37..50,59..69,78..96 +(5 rows) --3.3.2 = --3.3.2.1 ITEM(c1=) AND ITEM(c2=) AND ITEM(c3=) --expect: 40-43 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' AND c2='DDDD' AND c3=300.0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 = 'DDDD'::text) AND (c3 = 300::double precision)) - Selected Partitions: 40..43 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 = 'DDDD'::text) AND (c3 = 300::double precision)) + Selected Partitions: 40..43 +(5 rows) --3.3.3 Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text) AND (c3 < 100::double precision)) - Selected Partitions: 1,10,28 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 3 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 < 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text) AND (c3 < 100::double precision)) + Selected Partitions: 1,10,28 +(5 rows) --3.3.3.2 ITEM(c1<=) AND ITEM(c2<) AND ITEM(c3<) --NA @@ -1169,29 +1093,27 @@ select * from partition_pruning_multikey_t1 where c1<'2003-04-01 00:00:00' AND c --expect: 1 / 10 / 19 / 28 / 37 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<100.0; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 5 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 < 100::double precision)) - Selected Partitions: 1,10,19,28,37 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 5 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 < 100::double precision)) + Selected Partitions: 1,10,19,28,37 +(5 rows) --3.3.3.4 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=) --expect: 1-4 / 10-13 / 19 / 28-29 / 30-31 / 37-40 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 17 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision)) - Selected Partitions: 1..4,10..13,19,28..31,37..40 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 17 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision)) + Selected Partitions: 1..4,10..13,19,28..31,37..40 +(5 rows) --3.3.4 composite --3.3.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<) @@ -1202,15 +1124,14 @@ select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND --expect: 37-43 / 50 / 59 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c1<='2003-07-01 00:00:00' AND c2<='DDDD'; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 9 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) - Selected Partitions: 37..43,50,59 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 9 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) + Selected Partitions: 37..43,50,59 +(5 rows) --3.3.4.4 (ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>)) OR (ITEM(c1<) AND ITEM(c2<)) --NA @@ -1220,15 +1141,14 @@ select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND --expect: 1-4 / 10-13 / 19 / 28-31 / 37-40 / 50-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where (c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0) OR (c1>='2003-07-01 00:00:00' AND c2>='AAAA'); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 64 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision)) OR ((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'AAAA'::text))) - Selected Partitions: 1..4,10..13,19,28..31,37..40,50..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 64 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision)) OR ((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'AAAA'::text))) + Selected Partitions: 1..4,10..13,19,28..31,37..40,50..96 +(5 rows) --3.4 expression(c1,c2,c3,c4) --3.4.1 >/>= @@ -1236,15 +1156,14 @@ select * from partition_pruning_multikey_t1 where (c1<='2003-04-01 00:00:00' AND --expect: 50 / 59 / 62 / 64-65 / 67-69 / 87 / 90 / 92-93 / 95-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD' AND c3>100.0 AND c4>200; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 14 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c3 > 100::double precision) AND (c4 > 200)) - Selected Partitions: 50,59,62,64..65,67..69,87,90,92..93,95..96 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 14 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 > 'DDDD'::text) AND (c3 > 100::double precision) AND (c4 > 200)) + Selected Partitions: 50,59,62,64..65,67..69,87,90,92..93,95..96 +(5 rows) --3.4.1.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>) --NA @@ -1252,44 +1171,39 @@ select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c --expect: 39-40 / 42-43 / 45-46 / 48-50 / 59 / 61-62 / 64-65 / 67-69 / 78 / 80-81 / 83-84 / 86-87 / 89-90 / 92-93 / 95-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>200; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 30 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 > 200)) - Selected Partitions: 39..40,42..43,45..46,48..50,59,61..62,64..65,67..69,78,80..81,83..84,86..87,89..90,92..93,95..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 30 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 > 200)) + Selected Partitions: 39..40,42..43,45..46,48..50,59,61..62,64..65,67..69,78,80..81,83..84,86..87,89..90,92..93,95..96 +(5 rows) --3.4.1.4 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=) --expect: 39-50 / 59-69 / 78-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 42 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 >= 200)) - Selected Partitions: 39..50,59..69,78..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 42 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 >= 200)) + Selected Partitions: 39..50,59..69,78..96 +(5 rows) --3.4.2 = --3.4.2.1 ITEM(c1=) AND ITEM(c2=) AND ITEM(c3=) AND ITEM(c4=) --expect: 39 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' AND c2='DDDD' AND c3=100.0 AND c4=200; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 = 'DDDD'::text) AND (c3 = 100::double precision) AND (c4 = 200)) - Selected Partitions: 39 -(6 rows) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------- + Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 = 'DDDD'::text) AND (c3 = 100::double precision) AND (c4 = 200)) + Selected Partitions: 39 +(3 rows) --3.4.3 Partition Iterator - Iterations: 12 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision) AND (c4 < 200)) - Selected Partitions: 1..2,4,10..11,13,19,28..29,31,37..38 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 12 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision) AND (c4 < 200)) + Selected Partitions: 1..2,4,10..11,13,19,28..29,31,37..38 +(5 rows) --3.4.3.4 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=) AND ITEM(c4<=) --expect: 1-3 / 10-12 / 19 / 28-30 / 37-39 (4, 13, 31 should be eliminated) explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0 AND c4<=200; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 16 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision) AND (c4 <= 200)) - Selected Partitions: 1..4,10..13,19,28..31,37..39 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 16 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text) AND (c3 <= 100::double precision) AND (c4 <= 200)) + Selected Partitions: 1..4,10..13,19,28..31,37..39 +(5 rows) --3.4.4 composite --3.4.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>) AND ITEM(c1<) AND ITEM(c2<) @@ -1335,15 +1247,14 @@ explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200 AND c1<='2003-07-01 00:00:00' AND c2<='DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 7 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 >= 200) AND (c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) - Selected Partitions: 39..43,50,59 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 7 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 >= 200) AND (c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) + Selected Partitions: 39..43,50,59 +(5 rows) --3.4.4.4 (ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)) OR (ITEM(c1<) AND ITEM(c2<)) --NA @@ -1355,15 +1266,14 @@ explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where (c1>='2003-07-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200) OR (c1<='2003-04-01 00:00:00' AND c2<'DDDD'); - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 50 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 >= 200)) OR ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text))) - Selected Partitions: 1..10,28..37,59..69,78..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 50 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'DDDD'::text) AND (c3 >= 100::double precision) AND (c4 >= 200)) OR ((c1 <= 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 < 'DDDD'::text))) + Selected Partitions: 1..10,28..37,59..69,78..96 +(5 rows) --3.5 expression(c1,c3) @@ -1372,15 +1282,14 @@ where (c1>='2003-07-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200) --expect: 50-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00' AND c3>=100.0; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 47 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 >= 100::double precision)) - Selected Partitions: 50..96 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 47 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 >= 100::double precision)) + Selected Partitions: 50..96 +(5 rows) --3.5.2 = @@ -1388,116 +1297,108 @@ select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00' AND --expect: 50-53 / 59-62 / 68 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1='2003-07-01 00:00:00' AND c3=100.0; - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 9 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 = 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 = 100::double precision)) - Selected Partitions: 50..53,59..62,68 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 9 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 = 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 = 100::double precision)) + Selected Partitions: 50..53,59..62,68 +(5 rows) --3.5.3 Partition Iterator - Iterations: 33 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 <= 100::double precision)) - Selected Partitions: 1..4,10..13,19..22,28..31,37..40,43..46,50..53,59..62,68 -(6 rows) + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 33 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 <= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 <= 100::double precision)) + Selected Partitions: 1..4,10..13,19..22,28..31,37..40,43..46,50..53,59..62,68 +(5 rows) --3.5.4 composite --3.5.4.1 ITEM(c1>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<) --expect: 50-59 / 69 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00' AND c3>=100.0 AND c1<'2003-10-01 00:00:00' AND c2<='DDDD'; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 11 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 >= 100::double precision) AND (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) - Selected Partitions: 50..59,69 -(6 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 11 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c1 >= 'Tue Jul 01 00:00:00 2003'::timestamp without time zone) AND (c3 >= 100::double precision) AND (c1 < 'Wed Oct 01 00:00:00 2003'::timestamp without time zone) AND (c2 <= 'DDDD'::text)) + Selected Partitions: 50..59,69 +(5 rows) --3.6 expression(c2) --3.6.1 ITEM(c2>) --expect: 1 / 19-28 / 43-50 / 59-69 / 87-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c2>'DDDD'; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 40 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c2 > 'DDDD'::text) - Selected Partitions: 1,19..28,43..50,59..69,87..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 40 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c2 > 'DDDD'::text) + Selected Partitions: 1,19..28,43..50,59..69,87..96 +(5 rows) --3.6.2 ITEM(c2<) --expect: 1-10 / 28-37 / 50-59 / 69-78 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c2<'DDDD'; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 40 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: (c2 < 'DDDD'::text) - Selected Partitions: 1..10,28..37,50..59,69..78 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 40 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: (c2 < 'DDDD'::text) + Selected Partitions: 1..10,28..37,50..59,69..78 +(5 rows) --3.6.3 ITEM(c2>=) OR (ITEM(c1>) AND ITEM(c2>)) --expect: 1 / 19-28 / 43-50 / 59-69 / 87-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c2>'DDDD' OR (c1>'2003-04-01 00:00:00' AND c2>='HHHH'); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 40 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c2 > 'DDDD'::text) OR ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'HHHH'::text))) - Selected Partitions: 1,19..28,43..50,59..69,87..96 -(6 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------ + Partition Iterator + Iterations: 40 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c2 > 'DDDD'::text) OR ((c1 > 'Tue Apr 01 00:00:00 2003'::timestamp without time zone) AND (c2 >= 'HHHH'::text))) + Selected Partitions: 1,19..28,43..50,59..69,87..96 +(5 rows) --3.7 expression(c2,c4) --3.7.1 ITEM(c2>) AND ITEM(c4>) --expect: 1 / 19 / 21-22 / 24-25 / 27-28 / 43 / 45-46 / 48-50 / 59 / 61-62 / 64-65 / 67-69 / 87 / 89-90 / 92-93 / 95-96 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c2>'DDDD' AND c4>200; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c2 > 'DDDD'::text) AND (c4 > 200)) - Selected Partitions: 1,19,21..22,24..25,27..28,43,45..46,48..50,59,61..62,64..65,67..69,87,89..90,92..93,95..96 -(6 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c2 > 'DDDD'::text) AND (c4 > 200)) + Selected Partitions: 1,19,21..22,24..25,27..28,43,45..46,48..50,59,61..62,64..65,67..69,87,89..90,92..93,95..96 +(5 rows) --3.7.2 ITEM(c2<= AND ITEM(c4<=) --expect: 1-19 / 28-43 / 50-59 / 69-87 explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false) select * from partition_pruning_multikey_t1 where c2<='DDDD' AND c4<=200; - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 64 - -> Partitioned Seq Scan on partition_pruning_multikey_t1 - Filter: ((c2 <= 'DDDD'::text) AND (c4 <= 200)) - Selected Partitions: 1..19,28..43,50..59,69..87 -(6 rows) + QUERY PLAN +------------------------------------------------------------- + Partition Iterator + Iterations: 64 + -> Partitioned Seq Scan on partition_pruning_multikey_t1 + Filter: ((c2 <= 'DDDD'::text) AND (c4 <= 200)) + Selected Partitions: 1..19,28..43,50..59,69..87 +(5 rows) drop table partition_pruning_multikey_t1; diff --git a/src/test/regress/expected/hw_partition_scan_1.out b/src/test/regress/expected/hw_partition_scan_1.out index 76cf4c2ad..a72039e3d 100644 --- a/src/test/regress/expected/hw_partition_scan_1.out +++ b/src/test/regress/expected/hw_partition_scan_1.out @@ -56,134 +56,122 @@ SET enable_sort = ON; SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn < 10) - Selected Partitions: 1 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first + QUERY PLAN +-------------------------------------------------------- + Sort + Sort Key: sn + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn < 10) + Selected Partitions: 1 +(5 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 2 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn < 20) - Selected Partitions: 1..2 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions + QUERY PLAN +-------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 2 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn < 20) + Selected Partitions: 1..2 +(7 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 30) - Selected Partitions: 4 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last + QUERY PLAN +-------------------------------------------------------- + Sort + Sort Key: sn + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 30) + Selected Partitions: 4 +(5 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition + QUERY PLAN +-------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE +(7 rows) + +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions + QUERY PLAN +-------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(6 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort - Sort Key: sn + Sort Key: partition_scan_stu_info1.sn -> Partition Iterator Iterations: 0 -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) Selected Partitions: NONE -(8 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) -> Sort - Sort Key: sn + Sort Key: partition_scan_stu_info2.sn -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Seq Scan on partition_scan_stu_info2 Selected Partitions: 1..4 -(7 rows) +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE (16 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(17 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(17 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(16 rows) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; sn @@ -245,134 +233,103 @@ SET enable_sort = ON; SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn < 10) - Selected Partitions: 1 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first + QUERY PLAN +-------------------------------------------------------------------------------------------- + Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < 10) + Selected Partitions: 1 +(3 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 2 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn < 20) - Selected Partitions: 1..2 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < 20) + Selected Partitions: 1..2 +(5 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 30) - Selected Partitions: 4 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last + QUERY PLAN +-------------------------------------------------------------------------------------------- + Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 30) + Selected Partitions: 4 +(3 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE +(5 rows) + +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(4 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn + Merge Right Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 0 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE -(8 rows) +(12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(7 rows) + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(16 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; sn @@ -434,134 +391,103 @@ SET enable_sort = ON; SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn < 10) - Selected Partitions: 1 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first + QUERY PLAN +------------------------------------------------------------------------------------------------- + Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < 10) + Selected Partitions: 1 +(3 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 2 - -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn < 20) - Selected Partitions: 1..2 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions + QUERY PLAN +------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < 20) + Selected Partitions: 1..2 +(5 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 30) - Selected Partitions: 4 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last + QUERY PLAN +------------------------------------------------------------------------------------------------- + Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 30) + Selected Partitions: 4 +(3 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition + QUERY PLAN +------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 0 + -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE +(5 rows) + +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions + QUERY PLAN +------------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(4 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Right Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE -(8 rows) +(12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions - QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator - Iterations: 4 - -> Partitioned Index Only Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(7 rows) + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(16 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; sn @@ -623,83 +549,100 @@ SET enable_sort = ON; SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn < 10) - Selected Partitions: 1 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn < 10) -(10 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: sn + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn < 10) + Selected Partitions: 1 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn < 10) + Selected Partitions: 1 +(8 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 2 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn < 20) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions + QUERY PLAN +-------------------------------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 2 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn < 20) + Selected Partitions: 1..2 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn < 20) Selected Partitions: 1..2 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn < 20) (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 1 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 30) - Selected Partitions: 4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 30) -(10 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: sn + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 30) + Selected Partitions: 4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 30) + Selected Partitions: 4 +(8 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition + QUERY PLAN +-------------------------------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(4 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) Selected Partitions: 1..4 -(7 rows) +(17 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn -> Partition Iterator Iterations: 0 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 @@ -707,66 +650,45 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: NONE -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 Index Cond: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn -> Partition Iterator - Iterations: 4 + Iterations: 0 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 + Recheck Cond: (sn > 40) + Selected Partitions: NONE -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(16 rows) + Index Cond: (sn > 40) + Selected Partitions: NONE +(22 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(21 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(21 rows) +(22 rows) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; sn @@ -828,31 +750,29 @@ SET enable_sort = ON; SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,1)' ORDER BY SN; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Tid Scan on partition_scan_stu_info1 - TID Cond: (ctid = '(2,1)'::tid) - Selected Partitions: 1..4 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,1)' ORDER BY SN; + QUERY PLAN +-------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Tid Scan on partition_scan_stu_info1 + TID Cond: (ctid = '(2,1)'::tid) + Selected Partitions: 1..4 +(7 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,2)' ORDER BY SN; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Tid Scan on partition_scan_stu_info1 - TID Cond: (ctid = '(2,2)'::tid) - Selected Partitions: 1..4 -(8 rows) +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,2)' ORDER BY SN; + QUERY PLAN +-------------------------------------------------------------- + Sort + Sort Key: sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Tid Scan on partition_scan_stu_info1 + TID Cond: (ctid = '(2,2)'::tid) + Selected Partitions: 1..4 +(7 rows) SELECT CTID , * FROM partition_scan_stu_info1 ORDER BY SN; ctid | sn | name @@ -889,109 +809,65 @@ SET enable_nestloop = OFF; SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 @@ -999,49 +875,83 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(14 rows) +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -1137,109 +1047,65 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 @@ -1247,49 +1113,83 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -1383,109 +1283,65 @@ SET enable_nestloop = OFF; SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 @@ -1493,49 +1349,83 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -1629,116 +1519,52 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn = partition_scan_stu_info1.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) +(15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 @@ -1746,53 +1572,119 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) -(16 rows) + Selected Partitions: 1..4 +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(15 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(17 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (sn > 40) - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) +(19 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(19 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -1886,109 +1778,65 @@ SET enable_nestloop = OFF; SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 @@ -1996,49 +1844,83 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -2132,153 +2014,143 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +---------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 (12 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(13 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(13 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(13 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(12 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(13 rows) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +---------------------------------------------------------------------------- + Nested Loop Left Join + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +---------------------------------------------------------------------------- + Nested Loop + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +---------------------------------------------------------------------------- + Nested Loop + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(12 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -2374,111 +2246,49 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 (12 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) - Selected Partitions: 1..4 -(13 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 -(13 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 -(13 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 @@ -2486,39 +2296,91 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE -(12 rows) + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(11 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -2612,111 +2474,49 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 (12 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) - Selected Partitions: 1..4 -(13 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 -(13 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 -(13 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 @@ -2724,39 +2524,91 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE -(12 rows) + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(11 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -2850,119 +2702,52 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn = partition_scan_stu_info1.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn = partition_scan_stu_info1.sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) (15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(15 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) -(15 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 @@ -2970,49 +2755,115 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) -(16 rows) + Selected Partitions: 1..4 +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) -(16 rows) + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(17 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) -(16 rows) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(17 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(17 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -3106,111 +2957,49 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 (12 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) - Selected Partitions: 1..4 -(13 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 -(13 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 -(13 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 @@ -3218,39 +3007,91 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - Selected Partitions: NONE -(12 rows) + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(11 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Selected Partitions: NONE +(11 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -3344,129 +3185,34 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(17 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort Sort Key: partition_scan_stu_info1.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Sort Sort Key: partition_scan_stu_info2.sn -> Partition Iterator @@ -3475,49 +3221,134 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 (16 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort Sort Key: partition_scan_stu_info1.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Sort Sort Key: partition_scan_stu_info2.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(16 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(16 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +--------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort Sort Key: partition_scan_stu_info1.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Sort Sort Key: partition_scan_stu_info2.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(16 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(15 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(16 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(16 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -3613,180 +3444,149 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(17 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 -(16 rows) +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn + Selected Partitions: 1..4 +(13 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Right Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -3880,180 +3680,149 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(17 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 -(16 rows) +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn + Selected Partitions: 1..4 +(13 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -4147,128 +3916,52 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn = partition_scan_stu_info1.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) + Selected Partitions: 1..4 +(15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(17 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 @@ -4276,59 +3969,125 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) -(16 rows) + Selected Partitions: 1..4 +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(21 rows) +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(17 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(21 rows) +(22 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(22 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -4422,180 +4181,149 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(17 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(17 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 -(16 rows) +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Sort - Sort Key: partition_scan_stu_info2.sn + Selected Partitions: 1..4 +(13 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(17 rows) + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -4689,109 +4417,65 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 @@ -4799,49 +4483,83 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - Selected Partitions: NONE -(14 rows) +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -4937,158 +4655,149 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(13 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Right Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -5153,60 +4862,58 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join + Merge Right Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 0 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; @@ -5238,159 +4945,149 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -5455,61 +5152,58 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; @@ -5541,119 +5235,52 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn = partition_scan_stu_info1.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn = partition_scan_stu_info1.sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) (15 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(15 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) -(15 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Partition Iterator Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 @@ -5661,53 +5288,119 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) -(16 rows) + Selected Partitions: 1..4 +(15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(15 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(17 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (sn > 40) - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) +(19 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (sn > 40) - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) +(19 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -5772,72 +5465,75 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) + Selected Partitions: 1..4 +(17 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Partition Iterator - Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - Selected Partitions: 1..4 + Recheck Cond: (sn > 40) + Selected Partitions: NONE -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(16 rows) + Index Cond: (sn > 40) + Selected Partitions: NONE +(19 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (sn > 40) - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) +(19 rows) -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; @@ -5869,159 +5565,149 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash + Selected Partitions: 1..4 + -> Materialize -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Selected Partitions: 1..4 +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize -> Partition Iterator Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) - Selected Partitions: NONE -(14 rows) +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Materialize + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -6115,109 +5801,65 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(9 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(12 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Hash -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Seq Scan on partition_scan_stu_info2 Selected Partitions: 1..4 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info2 - Selected Partitions: 1..4 -(14 rows) +(13 rows) --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Partition Iterator Iterations: 4 @@ -6225,59 +5867,83 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) -(15 rows) + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Hash -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Selected Partitions: 1..4 + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(18 rows) +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + Selected Partitions: NONE +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -6413,135 +6079,125 @@ SET enable_nestloop = OFF; SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Seq Scan on partition_scan_stu_info2 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Seq Scan on partition_scan_stu_info2 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) -(11 rows) +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) Selected Partitions: NONE - -> Hash - -> Seq Scan on partition_scan_stu_info2 +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) -(11 rows) + Selected Partitions: NONE +(10 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE +(10 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -6637,135 +6293,125 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Right Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(10 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(10 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -6830,52 +6476,49 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Index Cond: (sn > 40) (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; @@ -6907,135 +6550,125 @@ SET enable_nestloop = OFF; SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Right Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +(10 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(10 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -7129,145 +6762,143 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(12 rows) + +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (partition_scan_stu_info1.sn = sn) -> Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) +(11 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(12 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(10 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Hash + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Hash + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (15 rows) -- rsult of cross join @@ -7333,62 +6964,62 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit (4 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Hash + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Hash + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (15 rows) -- result of no partition to join @@ -7421,135 +7052,125 @@ SET enable_nestloop = OFF; SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Hash - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Right Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +(10 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(10 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Hash + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(10 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -7643,129 +7264,119 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +---------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 + -> Seq Scan on partition_scan_stu_info2 (9 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Seq Scan on partition_scan_stu_info2 -(10 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Seq Scan on partition_scan_stu_info2 -(10 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Seq Scan on partition_scan_stu_info2 - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(10 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Seq Scan on partition_scan_stu_info2 (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE -> Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(9 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE - -> Seq Scan on partition_scan_stu_info2 +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +---------------------------------------------------------------------------- + Nested Loop Left Join + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) -(10 rows) + Selected Partitions: NONE + -> Seq Scan on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +---------------------------------------------------------------------------- + Nested Loop + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +---------------------------------------------------------------------------- + Nested Loop + Join Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -7861,128 +7472,117 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) (9 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) -(10 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(10 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 -(10 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) (9 rows) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(8 rows) + -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; name | phone @@ -8075,128 +7675,117 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) (9 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) -(10 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(10 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 -(10 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) (9 rows) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(8 rows) + -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; name | phone @@ -8289,144 +7878,138 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) Selected Partitions: 1..4 - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn = partition_scan_stu_info1.sn) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) (12 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(12 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) -(12 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (partition_scan_stu_info1.sn = sn) -> Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) -(13 rows) +(11 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(12 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) (13 rows) -- rsult of cross join @@ -8521,128 +8104,117 @@ SET enable_nestloop = ON; SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop -> Partition Iterator Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) (9 rows) --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) -(10 rows) - -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(10 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 -(10 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) (9 rows) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: ((sn = partition_scan_stu_info1.sn) AND (sn > 40)) +(8 rows) + -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; name | phone @@ -8735,156 +8307,146 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Seq Scan on partition_scan_stu_info2 -(14 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Seq Scan on partition_scan_stu_info2 -(14 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Seq Scan on partition_scan_stu_info2 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(14 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Seq Scan on partition_scan_stu_info2 -(14 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Left Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort Sort Key: partition_scan_stu_info1.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Sort Sort Key: partition_scan_stu_info2.sn -> Seq Scan on partition_scan_stu_info2 (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort Sort Key: partition_scan_stu_info1.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Sort Sort Key: partition_scan_stu_info2.sn -> Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) -(14 rows) +(13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Seq Scan on partition_scan_stu_info2 + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(13 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +--------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Sort Sort Key: partition_scan_stu_info1.sn -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Sort Sort Key: partition_scan_stu_info2.sn -> Seq Scan on partition_scan_stu_info2 +(13 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) -(14 rows) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Seq Scan on partition_scan_stu_info2 +(12 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +--------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) +(13 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -8980,142 +8542,118 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(12 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Right Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(12 rows) +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) -(12 rows) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -9209,142 +8747,119 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(12 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(12 rows) + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) -(12 rows) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -9438,98 +8953,111 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (12 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) +(11 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 (12 rows) -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) +(13 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn -> Partition Iterator Iterations: 0 -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 @@ -9537,56 +9065,36 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_s Selected Partitions: NONE -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 Index Cond: (sn > 40) - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(13 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (18 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Sort - Sort Key: partition_scan_stu_info2.sn - -> Bitmap Heap Scan on partition_scan_stu_info2 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Sort + Sort Key: partition_scan_stu_info1.sn + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 Index Cond: (sn > 40) + Selected Partitions: NONE + -> Sort + Sort Key: partition_scan_stu_info2.sn + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (18 rows) -- rsult of cross join @@ -9681,142 +9189,119 @@ SET enable_nestloop = OFF; SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Left Join - Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 -(12 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Merge Full Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(12 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join - Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(12 rows) + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Merge Join +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 Index Cond: (sn > 40) -(12 rows) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -9910,135 +9395,125 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Seq Scan on partition_scan_stu_info2 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Seq Scan on partition_scan_stu_info2 -> Hash -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 (10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Hash -> Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) -(11 rows) +(10 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + -> Hash -> Partition Iterator Iterations: 0 -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) Selected Partitions: NONE - -> Hash - -> Seq Scan on partition_scan_stu_info2 +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 Filter: (sn > 40) -(11 rows) + Selected Partitions: NONE +(10 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE +(10 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -10134,134 +9609,118 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Left Join + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) (9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain left outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Right Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -10355,136 +9814,119 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(10 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -10578,148 +10020,142 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) Selected Partitions: 1..4 - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn = partition_scan_stu_info1.sn) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn = partition_scan_stu_info1.sn) (12 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (partition_scan_stu_info1.sn = sn) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (partition_scan_stu_info1.sn = sn) -(12 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Nested Loop Left Join - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - -> Partition Iterator - Iterations: 4 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn = partition_scan_stu_info2.sn) - Selected Partitions: 1..4 - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn = partition_scan_stu_info2.sn) -(12 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Nested Loop Left Join -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Bitmap Heap Scan on partition_scan_stu_info2 Recheck Cond: (partition_scan_stu_info1.sn = sn) -> Bitmap Index Scan on index_on_partition_scan_stu_info2 Index Cond: (partition_scan_stu_info1.sn = sn) +(11 rows) + +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Nested Loop Left Join + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Partition Iterator + Iterations: 4 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn = partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(12 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (partition_scan_stu_info1.sn = sn) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (partition_scan_stu_info1.sn = sn) (13 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Hash + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (15 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 + Recheck Cond: (sn > 40) + Selected Partitions: NONE + -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 + Index Cond: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) + -> Hash + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) (15 rows) -- rsult of cross join @@ -10814,136 +10250,119 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Right Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name -> Merge Left Join Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Sort - Sort Key: partition_scan_stu_info1.sn - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 -(11 rows) +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +-- explain right outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Left Join + Merge Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + -> Materialize + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Selected Partitions: 1..4 +(10 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Merge Full Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator - Iterations: 0 + Iterations: 4 -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) + Selected Partitions: 1..4 + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(9 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 - Index Cond: (sn > 40) - Selected Partitions: NONE - -> Hash - -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 - Index Cond: (sn > 40) -(11 rows) +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Left Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 +(8 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Merge Join + Merge Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 0 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn > 40) + Selected Partitions: NONE + -> Index Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn > 40) +(9 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -11037,145 +10456,129 @@ SET enable_nestloop = ON; SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; - QUERY PLAN --------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; + QUERY PLAN +-------------------------------------------------------------- + Nested Loop + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Seq Scan on partition_scan_stu_info2 +(6 rows) + +-- explain inner join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) -> Partition Iterator Iterations: 4 -> Partitioned Seq Scan on partition_scan_stu_info1 Selected Partitions: 1..4 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(9 rows) - --- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Left Join - Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) - -> Seq Scan on partition_scan_stu_info2 - -> Hash - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(11 rows) - --- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name - -> Hash Full Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(11 rows) - --- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Right Join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Left Join Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) -> Seq Scan on partition_scan_stu_info2 -> Hash -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 +(10 rows) + +-- explain full outer join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; + QUERY PLAN +-------------------------------------------------------------------------------- + Sort + Sort Key: partition_scan_stu_info1.sn, partition_scan_stu_info1.name + -> Hash Full Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(10 rows) + +-- explain for no partition to join +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Seq Scan on partition_scan_stu_info2 + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE +(9 rows) + +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) + -> Hash + -> Partition Iterator + Iterations: 0 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) + Selected Partitions: NONE (12 rows) -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info2.sn = partition_scan_stu_info1.sn) + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) + -> Hash -> Partition Iterator Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (sn > 40) Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(15 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 0 - -> Partitioned Bitmap Heap Scan on partition_scan_stu_info1 - Recheck Cond: (sn > 40) - Selected Partitions: NONE - -> Partitioned Bitmap Index Scan on index_on_partition_scan_stu_info1 - Index Cond: (sn > 40) - -> Hash - -> Bitmap Heap Scan on partition_scan_stu_info2 - Recheck Cond: (sn > 40) - -> Bitmap Index Scan on index_on_partition_scan_stu_info2 - Index Cond: (sn > 40) -(15 rows) +(12 rows) -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; @@ -11259,24 +10662,21 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit ---- test WITH_QUERY & EXIST & IN -- -- EXPLAIN WITH_QUERY CASE: JOIN + EXISTS PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) SELECT STU_INFO2_VIEW.SN, partition_scan_stu_info1.NAME, STU_INFO2_VIEW.PHONE FROM STU_INFO2_VIEW LEFT JOIN partition_scan_stu_info1 ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN); - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Nested Loop Left Join - Join Filter: (partition_scan_stu_info1.sn < public.partition_scan_stu_info2.sn) - -> Seq Scan on partition_scan_stu_info2 - Filter: (sn < 40) - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(11 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn < 40) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(8 rows) -- RESULT OF WITH_QUERY CASE: JOIN + EXISTS PARTITION WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) @@ -11296,24 +10696,21 @@ ORDER BY 1, 2, 3; (7 rows) -- EXPLAIN WITH_QUERY CASE: JOIN + NON PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) SELECT STU_INFO2_VIEW.SN, partition_scan_stu_info1.NAME, STU_INFO2_VIEW.PHONE FROM STU_INFO2_VIEW LEFT JOIN partition_scan_stu_info1 ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN); - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - -> Nested Loop Left Join - Join Filter: (partition_scan_stu_info1.sn < public.partition_scan_stu_info2.sn) - -> Seq Scan on partition_scan_stu_info2 - Filter: (sn > 40) - -> Materialize - -> Streaming(type: BROADCAST) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 -(11 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Nested Loop Left Join + -> Seq Scan on partition_scan_stu_info2 + Filter: (sn > 40) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(8 rows) -- RESULT OF WITH_QUERY CASE: JOIN + NON PARTITION WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) @@ -11325,19 +10722,18 @@ ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN); (0 rows) -- EXPLAIN EXIST -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(8 rows) -- RESULT OF EXIST SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) order by 1; @@ -11350,19 +10746,18 @@ SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_i (4 rows) -- EXPLAIN NOT EXIST -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2); - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Selected Partitions: 1..4 - -> Hash - -> Seq Scan on partition_scan_stu_info2 -(9 rows) +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2); + QUERY PLAN +-------------------------------------------------------------------------- + Hash Join + Hash Cond: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Selected Partitions: 1..4 + -> Hash + -> Seq Scan on partition_scan_stu_info2 +(8 rows) -- RESULT OF NOT EXIST SELECT * FROM partition_scan_stu_info1 WHERE NOT EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); @@ -11371,22 +10766,18 @@ SELECT * FROM partition_scan_stu_info1 WHERE NOT EXISTS (SELECT partition_scan_s (0 rows) -- EXPLAIN IN -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (SubPlan 1) - Selected Partitions: 1..4 - SubPlan 1 - -> Result - Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); + QUERY PLAN +--------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (SubPlan 1) + Selected Partitions: 1..4 + SubPlan 1 + -> Index Only Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) +(8 rows) -- RESULT OF IN SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) order by 1; @@ -11399,22 +10790,18 @@ SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SEL (4 rows) -- EXPLAIN NOT IN -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on partition_scan_stu_info1 - Filter: (NOT (SubPlan 1)) - Selected Partitions: 1..4 - SubPlan 1 - -> Result - Filter: (partition_scan_stu_info1.sn = partition_scan_stu_info2.sn) - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on partition_scan_stu_info2 -(12 rows) +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); + QUERY PLAN +--------------------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on partition_scan_stu_info1 + Filter: (NOT (SubPlan 1)) + Selected Partitions: 1..4 + SubPlan 1 + -> Index Only Scan using index_on_partition_scan_stu_info2 on partition_scan_stu_info2 + Index Cond: (sn = partition_scan_stu_info1.sn) +(8 rows) -- RESULT OF NOT IN SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); @@ -11423,26 +10810,32 @@ SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (0 rows) -- EXPLAIN WITH_QUERY CASE: EXISTS PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) DELETE FROM partition_scan_stu_info1 USING partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN < partition_scan_stu_info2.SN AND partition_scan_stu_info2.SN IN (SELECT SN FROM STU_INFO2_VIEW) RETURNING partition_scan_stu_info1.NAME; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Delete on partition_scan_stu_info1 CTE stu_info2_view -> Sort Sort Key: public.partition_scan_stu_info2.sn - -> Data Node Scan on "__REMOTE_SORT_QUERY__" + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn < 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn < 40) -> Nested Loop - Join Filter: (partition_scan_stu_info1.sn < public.partition_scan_stu_info2.sn) -> Hash Semi Join Hash Cond: (public.partition_scan_stu_info2.sn = stu_info2_view.sn) - -> Data Node Scan on partition_scan_stu_info2 "_REMOTE_TABLE_QUERY_" + -> Seq Scan on partition_scan_stu_info2 -> Hash -> CTE Scan on stu_info2_view - -> Data Node Scan on partition_scan_stu_info1 "_REMOTE_TABLE_QUERY_" -(13 rows) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < public.partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(19 rows) -- RESULT OF WITH_QUERY CASE: EXISTS PARTITION with delete_partition_scan_stu_info1_NAME as ( @@ -11459,26 +10852,32 @@ select * from delete_partition_scan_stu_info1_NAME order by 1; (3 rows) -- EXPLAIN WITH_QUERY CASE: NONE PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) DELETE FROM partition_scan_stu_info1 USING partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN < partition_scan_stu_info2.SN AND partition_scan_stu_info2.SN IN (SELECT SN FROM STU_INFO2_VIEW) RETURNING partition_scan_stu_info1.NAME; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- Delete on partition_scan_stu_info1 CTE stu_info2_view -> Sort Sort Key: public.partition_scan_stu_info2.sn - -> Data Node Scan on "__REMOTE_SORT_QUERY__" + -> Bitmap Heap Scan on partition_scan_stu_info2 + Recheck Cond: (sn > 40) + -> Bitmap Index Scan on index_on_partition_scan_stu_info2 + Index Cond: (sn > 40) -> Nested Loop - Join Filter: (partition_scan_stu_info1.sn < public.partition_scan_stu_info2.sn) -> Hash Semi Join Hash Cond: (public.partition_scan_stu_info2.sn = stu_info2_view.sn) - -> Data Node Scan on partition_scan_stu_info2 "_REMOTE_TABLE_QUERY_" + -> Seq Scan on partition_scan_stu_info2 -> Hash -> CTE Scan on stu_info2_view - -> Data Node Scan on partition_scan_stu_info1 "_REMOTE_TABLE_QUERY_" -(13 rows) + -> Partition Iterator + Iterations: 4 + -> Partitioned Index Scan using index_on_partition_scan_stu_info1 on partition_scan_stu_info1 + Index Cond: (sn < public.partition_scan_stu_info2.sn) + Selected Partitions: 1..4 +(19 rows) -- RESULT OF EXPLAIN WITH_QUERY CASE: NONE PARTITION WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) diff --git a/src/test/regress/expected/hw_partition_scan_2.out b/src/test/regress/expected/hw_partition_scan_2.out index a9930a154..ced10362d 100644 --- a/src/test/regress/expected/hw_partition_scan_2.out +++ b/src/test/regress/expected/hw_partition_scan_2.out @@ -3119,10 +3119,35 @@ partition by range (Day) CREATE INDEX performance_select_index_index_000 ON fvt_data_partition_scan.performance_select_index_tbl_000(Day) LOCAL; SET ENABLE_SEQSCAN = FALSE; \! /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/./tmp_check/install//data2/moyq/install/GAUSS200_OLAP_TRUNK/bin/gs_guc reload -D /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/tmp_check/coordinator1 -Z coordinator -c "debug_print_plan=on" >/dev/null -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; +sh: /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/./tmp_check/install//data2/moyq/install/GAUSS200_OLAP_TRUNK/bin/gs_guc: No such file or directory +EXPLAIN (COSTS OFF) SELECT * FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; + QUERY PLAN +--------------------------------------------------------------------------------------- + Partition Iterator + Iterations: 2 + -> Partitioned Bitmap Heap Scan on performance_select_index_tbl_000 + Recheck Cond: ((day = 1) OR (day = 2)) + Selected Partitions: 3..4 + -> BitmapOr + -> Partitioned Bitmap Index Scan on performance_select_index_index_000 + Index Cond: (day = 1) + Selected Partitions: 3..4 + -> Partitioned Bitmap Index Scan on performance_select_index_index_000 + Index Cond: (day = 2) + Selected Partitions: 3..4 +(12 rows) + +\! /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/./tmp_check/install//data2/moyq/install/GAUSS200_OLAP_TRUNK/bin/gs_guc reload -D /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/tmp_check/coordinator1 -Z coordinator -c "debug_print_plan=off" >/dev/null +sh: /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/./tmp_check/install//data2/moyq/install/GAUSS200_OLAP_TRUNK/bin/gs_guc: No such file or directory +SELECT * FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; + starttime | starttimedstoffset | svrstarttime | stsvrdstoffset | endtime | endtimedstoffset | svrendtime | etsvrdstoffset | inserttime | timezoneoffset | objectno | granulityperiod | resultreliablityflag | day | counter_50331654 | counter_50331655 | counter_50331656 | counter_50331657 | counter_50331658 | counter_50331659 | counter_50331660 | counter_50331661 | counter_50331662 | counter_50331663 | counter_50331664 | counter_50331665 | counter_50331666 | counter_50331667 | counter_50331668 | counter_50331669 | counter_50331670 | counter_50331671 | counter_50331672 | counter_50331673 | counter_50331674 | counter_50331675 | counter_50331676 | counter_50331677 | counter_50331678 | counter_50331679 +-----------+--------------------+--------------+----------------+---------+------------------+------------+----------------+------------+----------------+----------+-----------------+----------------------+-----+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------ +(0 rows) + +EXPLAIN (COSTS OFF) SELECT COUNT(*) FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + Aggregate -> Partition Iterator Iterations: 2 -> Partitioned Bitmap Heap Scan on performance_select_index_tbl_000 @@ -3131,32 +3156,10 @@ EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM fvt_data_partition_scan.PERFORMANCE -> BitmapOr -> Partitioned Bitmap Index Scan on performance_select_index_index_000 Index Cond: (day = 1) + Selected Partitions: 3..4 -> Partitioned Bitmap Index Scan on performance_select_index_index_000 Index Cond: (day = 2) -(11 rows) - -\! /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/./tmp_check/install//data2/moyq/install/GAUSS200_OLAP_TRUNK/bin/gs_guc reload -D /data2/moyq/mppdb_svn/GAUSS200_OLAP_TRUNK/Code/src/test/regress/tmp_check/coordinator1 -Z coordinator -c "debug_print_plan=off" >/dev/null -SELECT * FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; - starttime | starttimedstoffset | svrstarttime | stsvrdstoffset | endtime | endtimedstoffset | svrendtime | etsvrdstoffset | inserttime | timezoneoffset | objectno | granulityperiod | resultreliablityflag | day | counter_50331654 | counter_50331655 | counter_50331656 | counter_50331657 | counter_50331658 | counter_50331659 | counter_50331660 | counter_50331661 | counter_50331662 | counter_50331663 | counter_50331664 | counter_50331665 | counter_50331666 | counter_50331667 | counter_50331668 | counter_50331669 | counter_50331670 | counter_50331671 | counter_50331672 | counter_50331673 | counter_50331674 | counter_50331675 | counter_50331676 | counter_50331677 | counter_50331678 | counter_50331679 ------------+--------------------+--------------+----------------+---------+------------------+------------+----------------+------------+----------------+----------+-----------------+----------------------+-----+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------+------------------ -(0 rows) - -EXPLAIN (COSTS OFF, NODES OFF) SELECT COUNT(*) FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; - QUERY PLAN ---------------------------------------------------------------------------------------------------------- - Aggregate - -> Streaming (type: GATHER) - -> Aggregate - -> Partition Iterator - Iterations: 2 - -> Partitioned Bitmap Heap Scan on performance_select_index_tbl_000 - Recheck Cond: ((day = 1) OR (day = 2)) Selected Partitions: 3..4 - -> BitmapOr - -> Partitioned Bitmap Index Scan on performance_select_index_index_000 - Index Cond: (day = 1) - -> Partitioned Bitmap Index Scan on performance_select_index_index_000 - Index Cond: (day = 2) (13 rows) SELECT COUNT(*) FROM fvt_data_partition_scan.PERFORMANCE_SELECT_INDEX_TBL_000 WHERE DAY =1 OR DAY =2 ; @@ -3191,12 +3194,12 @@ SELECT * FROM TEST_TIDSCAN_PARTITION ORDER BY 1; START TRANSACTION; CURSOR CUR FOR SELECT SCORE FROM TEST_TIDSCAN_PARTITION WHERE SCORE > 0; MOVE CUR; - EXPLAIN (COSTS OFF, NODES OFF) UPDATE TEST_TIDSCAN_PARTITION SET SCORE =SCORE+1 WHERE CURRENT OF CUR; + EXPLAIN (COSTS OFF) UPDATE TEST_TIDSCAN_PARTITION SET SCORE =SCORE+1 WHERE CURRENT OF CUR; ERROR: WHERE CURRENT OF clause not yet supported UPDATE TEST_TIDSCAN_PARTITION SET SCORE =SCORE+1 WHERE CURRENT OF CUR; ---?ERROR: current transaction is aborted, commands ignored until end of transaction block.* +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] CLOSE CUR; ---?ERROR: current transaction is aborted, commands ignored until end of transaction block.* +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] END; SELECT * FROM TEST_TIDSCAN_PARTITION ORDER BY 1; score @@ -3211,12 +3214,12 @@ SELECT * FROM TEST_TIDSCAN_PARTITION ORDER BY 1; START TRANSACTION; CURSOR CUR FOR SELECT SCORE FROM TEST_TIDSCAN_PARTITION WHERE SCORE > 0; MOVE CUR; - EXPLAIN (COSTS OFF, NODES OFF) DELETE FROM TEST_TIDSCAN_PARTITION WHERE CURRENT OF CUR; + EXPLAIN (COSTS OFF) DELETE FROM TEST_TIDSCAN_PARTITION WHERE CURRENT OF CUR; ERROR: WHERE CURRENT OF clause not yet supported DELETE FROM TEST_TIDSCAN_PARTITION WHERE CURRENT OF CUR; ---?ERROR: current transaction is aborted, commands ignored until end of transaction block.* +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] CLOSE CUR; ---?ERROR: current transaction is aborted, commands ignored until end of transaction block.* +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] END; SELECT * FROM TEST_TIDSCAN_PARTITION ORDER BY 1; score @@ -3370,11 +3373,20 @@ PARTITION BY RANGE (C_ID) PARTITION UPDATE_PARTITION_PICT_TABLE_059_7 VALUES LESS THAN (4000) ) ENABLE ROW MOVEMENT; +ERROR: Un-support feature +DETAIL: The distributed capability is not supported currently. CREATE INDEX UPDATE_PARTITION_PICT_TABLE_059_INDEX_001 ON fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059(C_ID) LOCAL; +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist CREATE INDEX UPDATE_PARTITION_PICT_TABLE_059_INDEX_002 ON fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059(C_ID) LOCAL; +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist CREATE INDEX UPDATE_PARTITION_PICT_TABLE_059_INDEX_003 ON fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059(C_ID , C_D_ID) LOCAL; +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist CREATE INDEX UPDATE_PARTITION_PICT_TABLE_059_INDEX_004 ON fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059(C_D_ID) LOCAL; +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist INSERT INTO fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059 SELECT C_ID , C_D_ID , C_W_ID , C_FIRST , C_MIDDLE , C_LAST , C_STREET_1 , C_STREET_2 , C_CITY FROM TPCC.CUSTOMER WHERE C_ID<2000 AND C_D_ID=6 AND C_W_ID =3; +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist on datanode1 +LINE 1: INSERT INTO fvt_data_partition_scan.UPDATE_PARTITION_PICT_T... + ^ UPDATE fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059 UPDATE_059 SET UPDATE_059.C_ID=UPDATE_059.C_ID+2000, UPDATE_059.C_D_ID=FROM_DD.D_ID+WITH_CC.W_ID, @@ -3383,18 +3395,18 @@ UPDATE fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059 UPDATE_059 SET (C_STREET_1 , C_STREET_2 , C_CITY )=(SELECT W_STREET_1 , W_STREET_2 , W_CITY FROM TPCC.WAREHOUSE WHERE W_ID=8) FROM fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_FROM_000 FROM_DD , fvt_data_partition_scan.WITH_UPDATE_TABLE_001 WITH_CC WHERE UPDATE_059.C_ID BETWEEN (SELECT W_ID*80 FROM TPCC.WAREHOUSE WHERE W_ID=10 ) AND 1000; -ERROR: Distributed key column can't be updated in current version +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist on datanode1 +LINE 1: UPDATE fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_... + ^ SELECT C_ID , C_D_ID , C_W_ID , C_FIRST , C_MIDDLE , C_LAST , C_STREET_1 , C_STREET_2 , C_CITY FROM fvt_data_partition_scan.UPDATE_PARTITION_PICT_TABLE_059 ORDER BY C_ID , C_D_ID , C_W_ID , C_FIRST , C_MIDDLE; - c_id | c_d_id | c_w_id | c_first | c_middle | c_last | c_street_1 | c_street_2 | c_city -------+--------+--------+---------+----------+--------+------------+------------+-------- -(0 rows) - +ERROR: relation "fvt_data_partition_scan.update_partition_pict_table_059" does not exist on datanode1 +LINE 1: ..., C_LAST , C_STREET_1 , C_STREET_2 , C_CITY FROM fvt_data_p... + ^ -- Clean up DROP SCHEMA fvt_data_partition_scan CASCADE; -NOTICE: drop cascades to 3 other objects +NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to table fvt_data_partition_scan.update_partition_pict_table_from_000 drop cascades to table fvt_data_partition_scan.with_update_table_001 -drop cascades to table fvt_data_partition_scan.update_partition_pict_table_059 DROP SCHEMA TPCC CASCADE; NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to table tpcc.customer @@ -3410,22 +3422,33 @@ PARTITION BY RANGE (a) PARTITION p1 VALUES LESS THAN (200), PARTITION p2 VALUES LESS THAN (300) ); +ERROR: Un-support feature +DETAIL: The distributed capability is not supported currently. COPY hw_partition_scan_tenk3 (a, b) FROM stdin; +ERROR: relation "hw_partition_scan_tenk3" does not exist +10 2015-04-25 18:41:30.483823 +20 2015-04-25 18:41:30.489231 +30 2015-04-30 18:41:30.482444 +40 2015-04-22 18:41:30.487192 +50 2015-04-27 18:41:30.48514 +60 2015-04-22 18:41:30.480243 +\. +invalid command \. ; +ERROR: syntax error at or near "10" +LINE 1: 10 2015-04-25 18:41:30.483823 + ^ CREATE INDEX hw_partition_scan_tenk3_idx_1 ON hw_partition_scan_tenk3 USING btree (b) LOCAL(PARTITION p0_b_idx, PARTITION p1_b_idx, PARTITION p2_b_idx) ; +ERROR: relation "hw_partition_scan_tenk3" does not exist ANALYZE hw_partition_scan_tenk3; +ERROR: relation "hw_partition_scan_tenk3" does not exist SET ENABLE_FAST_QUERY_SHIPPING = OFF; +ERROR: unrecognized configuration parameter "enable_fast_query_shipping" SET ENABLE_SEQSCAN = OFF; SET ENABLE_INDEXSCAN = OFF; SELECT * FROM HW_PARTITION_SCAN_TENK3 WHERE B > TO_DATE('2015-04-22 00:00:00','YYYY-MM-DD HH24:MI:SS') ORDER BY 1; - a | b -----+--------------------------------- - 10 | Sat Apr 25 18:41:30.483823 2015 - 20 | Sat Apr 25 18:41:30.489231 2015 - 30 | Thu Apr 30 18:41:30.482444 2015 - 40 | Wed Apr 22 18:41:30.487192 2015 - 50 | Mon Apr 27 18:41:30.48514 2015 - 60 | Wed Apr 22 18:41:30.480243 2015 -(6 rows) - +ERROR: relation "hw_partition_scan_tenk3" does not exist on datanode1 +LINE 1: SELECT * FROM HW_PARTITION_SCAN_TENK3 WHERE B > TO_DATE('201... + ^ DROP TABLE HW_PARTITION_SCAN_TENK3; +ERROR: table "hw_partition_scan_tenk3" does not exist diff --git a/src/test/regress/expected/hw_partition_select0.out b/src/test/regress/expected/hw_partition_select0.out index 80b156958..354c34453 100644 --- a/src/test/regress/expected/hw_partition_select0.out +++ b/src/test/regress/expected/hw_partition_select0.out @@ -34,10 +34,12 @@ ERROR: inserted partition key does not map to any table partition insert into test_partition_for_null_range values (0, null, null, null); -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range partition for (null, null) order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range partition for (null, 0) order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- success select * from test_partition_for_null_range partition for (0, null) order by 1, 2, 3, 4; a | b | c | d @@ -99,7 +101,8 @@ ERROR: inserted partition key does not map to any table partition insert into test_partition_for_null_interval values (0, null); -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_interval partition for (null) order by 1, 2; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- failed: The partition number is invalid or out-of-range alter table test_partition_for_null_interval rename partition for (null) to test_partition_for_null_interval_part1; ERROR: The partition number is invalid or out-of-range @@ -128,10 +131,12 @@ ERROR: inserted partition key does not map to any table partition insert into test_partition_for_null_range_text values ('A', null, null, null); -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range_text partition for (null, null) order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range_text partition for (null, 'A') order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- success select * from test_partition_for_null_range_text partition for ('A', null) order by 1, 2, 3, 4; a | b | c | d @@ -194,10 +199,12 @@ ERROR: inserted partition key does not map to any table partition insert into test_partition_for_null_range_timestamp values ('2000-01-01 01:01:01', null, null, null); -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range_timestamp partition for (null, null) order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range_timestamp partition for (null, '2000-01-01 01:01:01+01') order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- success select * from test_partition_for_null_range_timestamp partition for ('2000-01-01 01:01:01', null) order by 1, 2, 3, 4; a | b | c | d @@ -257,7 +264,8 @@ ERROR: inserted partition key does not map to any table partition insert into test_partition_for_null_interval_timestamp values ('2000-01-01 00:00:00', null); -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_interval_timestamp partition for (null) order by 1, 2; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- failed: The partition number is invalid or out-of-range alter table test_partition_for_null_interval_timestamp rename partition for (null) to test_partition_for_null_interval_timestamp_part1; ERROR: The partition number is invalid or out-of-range @@ -367,10 +375,12 @@ ERROR: inserted partition key does not map to any table partition insert into test_partition_for_null_range_and_maxvalue_2 values (0, null, null, null); -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range_and_maxvalue_2 partition for (null, null) order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- failed: The partition number is invalid or out-of-range select * from test_partition_for_null_range_and_maxvalue_2 partition for (null, 0) order by 1, 2, 3, 4; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. -- success: select partition p1 select * from test_partition_for_null_range_and_maxvalue_2 partition for (0, null) order by 1, 2, 3, 4; a | b | c | d @@ -443,7 +453,8 @@ INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','i INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1100,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09'); INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1600,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09'); select * from select_partition_table_000_3 partition for (NULL) order by C_INT; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. alter table select_partition_table_000_3 rename partition for (NULL) to select_partition_table_000_3_p1; ERROR: The partition number is invalid or out-of-range alter table select_partition_table_000_3 drop partition for (NULL); @@ -486,7 +497,8 @@ INSERT INTO select_partition_table_000_4 VALUES('I','IJK','IJKLMNO','i','ijk','i INSERT INTO select_partition_table_000_4 VALUES('J','IJK','IJKLMNO','j','jkl','jklmnop',1111,111111,111,11.1,11.11,11.111,'2000-09-09','2000-10-02 09:09:09','2000-10-02 09:09:09+09'); INSERT INTO select_partition_table_000_4 VALUES('K','JKl','IJKLMNO','j','jkl','jklmnop',1111,111111,111,11.1,11.11,11.111,'2000-09-09','2000-10-06 09:09:09','2000-10-06 09:09:09+09'); select C_INT,C_TS_WITHOUT from select_partition_table_000_4 partition for (null) order by 1, 2; -ERROR: The partition number is invalid or out-of-range +ERROR: Cannot find partition by the value +DETAIL: N/A. alter table select_partition_table_000_4 rename partition for (null) to select_partition_table_000_4_p1; ERROR: The partition number is invalid or out-of-range alter table select_partition_table_000_4 drop partition for (null); @@ -25202,20 +25214,7 @@ PARTITION BY RANGE (A) PARTITION HW_PARTITION_SELECT_RT_P3 VALUES LESS THAN (7) ); EXPLAIN (COSTS OFF, NODES OFF) SELECT B FROM (SELECT B FROM HW_PARTITION_SELECT_RT LIMIT 100) ORDER BY B; - QUERY PLAN ------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Sort - Sort Key: hw_partition_select_rt.b - -> Limit - -> Streaming(type: BROADCAST) - -> Limit - -> Partition Iterator - Iterations: 3 - -> Partitioned Seq Scan on hw_partition_select_rt - Selected Partitions: 1..3 -(10 rows) - +ERROR: unrecognized EXPLAIN option "nodes" --CREATE TABLE HW_PARTITION_SELECT_PTEST(A INT, B INT) --PARTITION BY RANGE(A) --INTERVAL(1000) @@ -25253,7 +25252,8 @@ partition by range (C_CHAR_3) partition RANGE_PARTITION_000_1 values less than ('DDDDD'), partition RANGE_PARTITION_000_2 values less than ('ZZZZZ') ); -ERROR: relation "hw_partition_select_rangetab" already exists +ERROR: relation "hw_partition_select_rangetab" already exists in schema "fvt_compress_qwer" +DETAIL: creating new table with existing name in the same schema select * from hw_partition_select_rangetab where length(C_CHAR_3)>5 order by 1, 2; c_char_3 | c_int ----------+------- @@ -25296,33 +25296,24 @@ INSERT INTO select_partition_table_000_2 VALUES('I','IJK','IJKLMNO','i','ijk','i create index select_partition_table_index_000_2 ON select_partition_table_000_2(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION select_partition_000_2_1, PARTITION select_partition_000_2_3); create view select_partition_table_view_000_2 as select * from select_partition_table_000_2; explain (costs off, verbose on) select lower(C_CHAR_3), initcap(C_VARCHAR_3), sqrt(C_INT), C_NUMERIC- 1 + 2*6/3, rank() over w from select_partition_table_000_2 where C_INT > 600 or C_BIGINT < 444444 window w as (partition by C_TS_WITHOUT) order by 1,2,3,4,5; -WARNING: Statistics in some tables or columns(fvt_compress_qwer.select_partition_table_000_2.c_char_1, fvt_compress_qwer.select_partition_table_000_2.c_int, fvt_compress_qwer.select_partition_table_000_2.c_bigint, fvt_compress_qwer.select_partition_table_000_2.c_ts_without) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + Sort Output: (lower((c_char_3)::text)), (initcap((c_varchar_3)::text)), (sqrt((c_int)::double precision)), ((((c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY c_ts_without)), c_ts_without - Merge Sort Key: (lower((select_partition_table_000_2.c_char_3)::text)), (initcap((select_partition_table_000_2.c_varchar_3)::text)), (sqrt((select_partition_table_000_2.c_int)::double precision)), ((((select_partition_table_000_2.c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY select_partition_table_000_2.c_ts_without)) - -> Sort - Output: (lower((c_char_3)::text)), (initcap((c_varchar_3)::text)), (sqrt((c_int)::double precision)), ((((c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY c_ts_without)), c_ts_without - Sort Key: (lower((select_partition_table_000_2.c_char_3)::text)), (initcap((select_partition_table_000_2.c_varchar_3)::text)), (sqrt((select_partition_table_000_2.c_int)::double precision)), ((((select_partition_table_000_2.c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY select_partition_table_000_2.c_ts_without)) - -> WindowAgg - Output: lower((c_char_3)::text), initcap((c_varchar_3)::text), sqrt((c_int)::double precision), (((c_numeric - 1::numeric))::double precision + 4::double precision), rank() OVER (PARTITION BY c_ts_without), c_ts_without - -> Sort + Sort Key: (lower((select_partition_table_000_2.c_char_3)::text)), (initcap((select_partition_table_000_2.c_varchar_3)::text)), (sqrt((select_partition_table_000_2.c_int)::double precision)), ((((select_partition_table_000_2.c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY select_partition_table_000_2.c_ts_without)) + -> WindowAgg + Output: lower((c_char_3)::text), initcap((c_varchar_3)::text), sqrt((c_int)::double precision), (((c_numeric - 1::numeric))::double precision + 4::double precision), rank() OVER (PARTITION BY c_ts_without), c_ts_without + -> Sort + Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric + Sort Key: select_partition_table_000_2.c_ts_without + -> Partition Iterator Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Sort Key: select_partition_table_000_2.c_ts_without - -> Streaming(type: REDISTRIBUTE) + Iterations: 2 + -> Partitioned Seq Scan on fvt_compress_qwer.select_partition_table_000_2 Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Distribute Key: c_ts_without - -> Partition Iterator - Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Iterations: 2 - -> Partitioned Seq Scan on fvt_compress_qwer.select_partition_table_000_2 - Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Distribute Key: c_char_1 - Filter: ((select_partition_table_000_2.c_int > 600) OR (select_partition_table_000_2.c_bigint < 444444)) - Selected Partitions: 1..2 -(22 rows) + Filter: ((select_partition_table_000_2.c_int > 600) OR (select_partition_table_000_2.c_bigint < 444444)) + Selected Partitions: 1..2 +(15 rows) select lower(C_CHAR_3), initcap(C_VARCHAR_3), sqrt(C_INT), C_NUMERIC- 1 + 2*6/3, rank() over w from select_partition_table_000_2 where C_INT > 600 or C_BIGINT < 444444 window w as (partition by C_TS_WITHOUT) order by 1,2,3,4,5; lower | initcap | sqrt | ?column? | rank @@ -25360,11 +25351,13 @@ CREATE TABLE select_partition_table_000_3( partition select_partition_000_3_1 values less than (500), partition select_partition_000_3_3 values less than (2000) ); -ERROR: relation "select_partition_table_000_3" already exists +ERROR: relation "select_partition_table_000_3" already exists in schema "fvt_compress_qwer" +DETAIL: creating new table with existing name in the same schema create index select_partition_table_index_000_3 ON select_partition_table_000_3(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(partition select_partition_000_3_1, partition select_partition_000_3_3); ERROR: relation "select_partition_table_index_000_3" already exists create view select_partition_table_view_000_3 as select * from select_partition_table_000_3; -ERROR: relation "select_partition_table_view_000_3" already exists +ERROR: relation "select_partition_table_view_000_3" already exists in schema "fvt_compress_qwer" +DETAIL: creating new table with existing name in the same schema INSERT INTO select_partition_table_000_3 VALUES('A','ABC','ABCDEFG','a','abc','abcdefg',111,111111,11,1.1,1.11,1.111,'2000-01-01','2000-01-01 01:01:01','2000-01-01 01:01:01+01'); INSERT INTO select_partition_table_000_3 VALUES('B','BCD','BCDEFGH','b','bcd','bcdefgh',222,222222,22,2.2,2.22,2.222,'2000-02-02','2000-02-02 02:02:02','2000-02-02 02:02:02+02'); INSERT INTO select_partition_table_000_3 VALUES('C','CDE','CDEFGHI','c','cde','cdefghi',333,333333,33,3.3,3.33,3.333,'2000-03-03','2000-03-03 03:03:03','2000-03-03 03:03:03+03'); @@ -25379,33 +25372,24 @@ INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','i INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1100,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09'); INSERT INTO select_partition_table_000_3 VALUES('I','IJK','IJKLMNO','i','ijk','ijklmno',1600,999999,99,9.9,9.99,9.999,'2000-09-09','2000-09-09 09:09:09','2000-09-09 09:09:09+09'); explain (costs off, verbose on) select lower(C_CHAR_3), initcap(C_VARCHAR_3), sqrt(C_INT), C_NUMERIC- 1 + 2*6/3, rank() over w from select_partition_table_000_3 where C_INT > 600 or C_BIGINT < 444444 window w as (partition by C_TS_WITHOUT) order by 1,2,3,4,5; -WARNING: Statistics in some tables or columns(fvt_compress_qwer.select_partition_table_000_3.c_char_1, fvt_compress_qwer.select_partition_table_000_3.c_int, fvt_compress_qwer.select_partition_table_000_3.c_bigint, fvt_compress_qwer.select_partition_table_000_3.c_ts_without) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + Sort Output: (lower((c_char_3)::text)), (initcap((c_varchar_3)::text)), (sqrt((c_int)::double precision)), ((((c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY c_ts_without)), c_ts_without - Merge Sort Key: (lower((select_partition_table_000_3.c_char_3)::text)), (initcap((select_partition_table_000_3.c_varchar_3)::text)), (sqrt((select_partition_table_000_3.c_int)::double precision)), ((((select_partition_table_000_3.c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY select_partition_table_000_3.c_ts_without)) - -> Sort - Output: (lower((c_char_3)::text)), (initcap((c_varchar_3)::text)), (sqrt((c_int)::double precision)), ((((c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY c_ts_without)), c_ts_without - Sort Key: (lower((select_partition_table_000_3.c_char_3)::text)), (initcap((select_partition_table_000_3.c_varchar_3)::text)), (sqrt((select_partition_table_000_3.c_int)::double precision)), ((((select_partition_table_000_3.c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY select_partition_table_000_3.c_ts_without)) - -> WindowAgg - Output: lower((c_char_3)::text), initcap((c_varchar_3)::text), sqrt((c_int)::double precision), (((c_numeric - 1::numeric))::double precision + 4::double precision), rank() OVER (PARTITION BY c_ts_without), c_ts_without - -> Sort + Sort Key: (lower((select_partition_table_000_3.c_char_3)::text)), (initcap((select_partition_table_000_3.c_varchar_3)::text)), (sqrt((select_partition_table_000_3.c_int)::double precision)), ((((select_partition_table_000_3.c_numeric - 1::numeric))::double precision + 4::double precision)), (rank() OVER (PARTITION BY select_partition_table_000_3.c_ts_without)) + -> WindowAgg + Output: lower((c_char_3)::text), initcap((c_varchar_3)::text), sqrt((c_int)::double precision), (((c_numeric - 1::numeric))::double precision + 4::double precision), rank() OVER (PARTITION BY c_ts_without), c_ts_without + -> Sort + Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric + Sort Key: select_partition_table_000_3.c_ts_without + -> Partition Iterator Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Sort Key: select_partition_table_000_3.c_ts_without - -> Streaming(type: REDISTRIBUTE) + Iterations: 2 + -> Partitioned Seq Scan on fvt_compress_qwer.select_partition_table_000_3 Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Distribute Key: c_ts_without - -> Partition Iterator - Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Iterations: 2 - -> Partitioned Seq Scan on fvt_compress_qwer.select_partition_table_000_3 - Output: c_ts_without, c_char_3, c_varchar_3, c_int, c_numeric - Distribute Key: c_char_1 - Filter: ((select_partition_table_000_3.c_int > 600) OR (select_partition_table_000_3.c_bigint < 444444)) - Selected Partitions: 1..2 -(22 rows) + Filter: ((select_partition_table_000_3.c_int > 600) OR (select_partition_table_000_3.c_bigint < 444444)) + Selected Partitions: 1..2 +(15 rows) select lower(C_CHAR_3), initcap(C_VARCHAR_3), sqrt(C_INT), C_NUMERIC- 1 + 2*6/3, rank() over w from select_partition_table_000_3 where C_INT > 600 or C_BIGINT < 444444 window w as (partition by C_TS_WITHOUT) order by 1,2,3,4,5; lower | initcap | sqrt | ?column? | rank diff --git a/src/test/regress/expected/hw_partition_unusable_index_3.out b/src/test/regress/expected/hw_partition_unusable_index_3.out index 9f91046f1..65b16df67 100644 --- a/src/test/regress/expected/hw_partition_unusable_index_3.out +++ b/src/test/regress/expected/hw_partition_unusable_index_3.out @@ -161,7 +161,7 @@ ALTER INDEX idx1_table_unusable_index_exchange REBUILD; ALTER INDEX idx1_partition_unsable_index_3 UNUSABLE; ALTER TABLE partition_unsable_index_3 EXCHANGE PARTITION (p1_partition_unsable_index_3) WITH TABLE table_unusable_index_exchange; -ERROR: index mismatch for tables in ALTER TABLE EXCHANGE PARTITION +ERROR: tables in ALTER TABLE EXCHANGE PARTITION must have the same number of indexs ALTER INDEX idx1_partition_unsable_index_3 REBUILD; -- modify one index partition unusable -- exchange failed due to unusable index partition diff --git a/src/test/regress/expected/hw_partition_vacuum.out b/src/test/regress/expected/hw_partition_vacuum.out index 8723099b6..9da58845f 100644 --- a/src/test/regress/expected/hw_partition_vacuum.out +++ b/src/test/regress/expected/hw_partition_vacuum.out @@ -61,7 +61,7 @@ select relname, relpages >0 as relpagesgtzero, reltuples >0 as reltuplesgtzero f -------------------------------------+----------------+----------------- hw_partition_vacuum_partition_table | t | t inx_btree_id | t | t - inx_hash_id | t | t + inx_hash_id | f | f (3 rows) --i9. vacuum index @@ -73,7 +73,7 @@ select relname, relpages >0 as relpagesgtzero, reltuples >0 as reltuplesgtzero f -------------------------------------+----------------+----------------- hw_partition_vacuum_partition_table | t | t inx_btree_id | t | t - inx_hash_id | t | t + inx_hash_id | f | f (3 rows) --i11. delete all the tuples @@ -94,9 +94,9 @@ vacuum; select relname, relpages >0 as relpagesgtzero, reltuples >0 as reltuplesgtzero from pg_class where relname='hw_partition_vacuum_partition_table' or relname='inx_btree_id' or relname='inx_hash_id' order by 1; relname | relpagesgtzero | reltuplesgtzero -------------------------------------+----------------+----------------- - hw_partition_vacuum_partition_table | f | f - inx_btree_id | t | f - inx_hash_id | t | f + hw_partition_vacuum_partition_table | t | t + inx_btree_id | t | t + inx_hash_id | f | f (3 rows) --i14. selete table diff --git a/src/test/regress/expected/hw_partition_vacuum_full.out b/src/test/regress/expected/hw_partition_vacuum_full.out index 9c33be868..672d5e39f 100644 --- a/src/test/regress/expected/hw_partition_vacuum_full.out +++ b/src/test/regress/expected/hw_partition_vacuum_full.out @@ -44,7 +44,7 @@ vacuum full hw_partition_vacuum_full_partition_table partition(hw_partition_vacu select relpages, reltuples from pg_partition where relname='hw_partition_vacuum_full_partition_table_p1'; relpages | reltuples ----------+----------- - 0 | 0 + 7 | 999 (1 row) select relpages > 0 as relpagesgtzero, reltuples > 0 as reltuplesgtzero from pg_class where relname='hw_partition_vacuum_full_partition_table'; @@ -65,7 +65,7 @@ vacuum full hw_partition_vacuum_full_partition_table partition(hw_partition_vacu select relpages, reltuples from pg_partition where relname='hw_partition_vacuum_full_partition_table_p2'; relpages | reltuples ----------+----------- - 0 | 0 + 7 | 999 (1 row) select relpages > 0 as relpagesgtzero, reltuples > 0 as reltuplesgtzero from pg_class where relname='hw_partition_vacuum_full_partition_table'; @@ -81,7 +81,7 @@ vacuum full hw_partition_vacuum_full_partition_table; select relpages > 0 as relpagesgtzero, reltuples > 0 as reltuplesgtzero from pg_class where relname='hw_partition_vacuum_full_partition_table'; relpagesgtzero | reltuplesgtzero ----------------+----------------- - f | f + t | t (1 row) select * from hw_partition_vacuum_full_partition_table order by 1, 2, 3; diff --git a/src/test/regress/expected/hw_rewrite_lazyagg.out b/src/test/regress/expected/hw_rewrite_lazyagg.out index ffad79dc8..d8ddf7db5 100644 --- a/src/test/regress/expected/hw_rewrite_lazyagg.out +++ b/src/test/regress/expected/hw_rewrite_lazyagg.out @@ -2309,30 +2309,24 @@ explain (costs off, verbose on) select t.b, sum(cc) + sum(cc) from (select b, co ------------------------------------------------------------------------------------ -- basic with as explain (costs off, verbose on) with s as (select b, sum(c) as cc from t1 group by b) select t.b, sum(cc) from s, t where s.b=t.b group by t.b order by 1,2; - QUERY PLAN ------------------------------------------------- + QUERY PLAN +---------------------------------------------------- Sort - Output: t.b, (sum(s.cc)) - Sort Key: t.b, (sum(s.cc)) - CTE s - -> HashAggregate - Output: t1.b, sum(t1.c) - Group By Key: t1.b - -> Seq Scan on lazyagg.t1 - Output: t1.b, t1.c + Output: t.b, (sum((t1.c)::bigint)) + Sort Key: t.b, (sum((t1.c)::bigint)) -> HashAggregate - Output: t.b, sum(s.cc) + Output: t.b, sum((t1.c)::bigint) Group By Key: t.b -> Hash Join - Output: s.cc, t.b - Hash Cond: (t.b = s.b) - -> Seq Scan on lazyagg.t - Output: t.a, t.b, t.c, t.d + Output: t1.c, t.b + Hash Cond: (t1.b = t.b) + -> Seq Scan on lazyagg.t1 + Output: t1.a, t1.b, t1.c, t1.d -> Hash - Output: s.cc, s.b - -> CTE Scan on s - Output: s.cc, s.b -(21 rows) + Output: t.b + -> Seq Scan on lazyagg.t + Output: t.b +(15 rows) -- multi-usage explain (costs off, verbose on) with s1(b, cc) as (select b, sum(c) from t1 group by b) select count(*) from s1 where cc > (select sum(cc)/100 from s1) order by 1; diff --git a/src/test/regress/expected/inlist2join_c.out b/src/test/regress/expected/inlist2join_c.out index d3d1963ca..eacb80e1c 100644 --- a/src/test/regress/expected/inlist2join_c.out +++ b/src/test/regress/expected/inlist2join_c.out @@ -1,501 +1,503 @@ -create schema inlist2join_c; -set current_schema=inlist2join_c; -set qrw_inlist2join_optmode=1; -create table t1(c1 int, c2 int, c3 int) with (orientation=column) distribute by hash(c1); -insert into t1 select v,v,v from generate_series(1,12) as v; -create table t2(c1 int, c2 int, c3 int) with (orientation=column) distribute by hash(c1); -insert into t2 select v,v,v from generate_series(1,10) as v; -explain (costs off) select c1,c2 from t1 where t1.c2 in (3,4,7); - QUERY PLAN ---------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" -(7 rows) - -select c1,c2 from t1 where t1.c2 in (3,4,7) order by 1; - c1 | c2 -----+---- - 3 | 3 - 4 | 4 - 7 | 7 -(3 rows) - -explain (costs off) select c1,c3 from t1 where t1.c2 in (3,4,7); - QUERY PLAN ---------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" -(7 rows) - -select c1,c3 from t1 where t1.c3 in (3,4,7) order by 1; - c1 | c3 -----+---- - 3 | 3 - 4 | 4 - 7 | 7 -(3 rows) - -explain (costs off) select c2,c3 from t1 where t1.c2 in (3,4,7); - QUERY PLAN ---------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" -(7 rows) - -select c2,c3 from t1 where t1.c3 in (3,4,7) order by 1; - c2 | c3 -----+---- - 3 | 3 - 4 | 4 - 7 | 7 -(3 rows) - -explain (costs off) select t1.c1 as c1, t2.c2 as c2 -from t1,t2 -where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) -order by 1,2; - QUERY PLAN ---------------------------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2 - -> Vector Sort - Sort Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2 - -> Vector Nest Loop - Join Filter: (inlist2join_c.t1.c1 = inlist2join_c.t2.c1) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> Vector Materialize - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t2.c1 = "*VALUES*".column1) - -> CStore Scan on t2 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" -(20 rows) - -select t1.c1 as c1, t2.c2 as c2 -from t1,t2 -where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) -order by 1,2; - c1 | c2 -----+---- - 3 | 3 - 4 | 4 - 5 | 5 - 6 | 6 -(4 rows) - -explain (costs off) select * from +create schema inlist2join_type_c; +set current_schema=inlist2join_type_c; +set qrw_inlist2join_optmode = cost_base; +create table type ( - select t1.c1 as c1, t2.c2 as c2, count(*) as sum - from t1,t2 - where t1.c1 = t2.c1 - group by 1,2 -) as dt where dt.c1 in (3,4,5,6) -order by 1,2,3; - QUERY PLAN ---------------------------------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2, (count(*)) - -> Vector Sort - Sort Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2, (count(*)) - -> Vector Sonic Hash Aggregate - Group By Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2 - -> Vector Nest Loop - Join Filter: (inlist2join_c.t1.c1 = inlist2join_c.t2.c1) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> Vector Materialize - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t2.c1 = "*VALUES*".column1) - -> CStore Scan on t2 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" -(22 rows) - -select * from -( - select t1.c1 as c1, t2.c2 as c2, count(*) as sum - from t1,t2 - where t1.c1 = t2.c1 - group by 1,2 -) as dt where dt.c1 in (3,4,5,6) -order by 1,2,3; - c1 | c2 | sum -----+----+----- - 3 | 3 | 1 - 4 | 4 | 1 - 5 | 5 | 1 - 6 | 6 | 1 -(4 rows) - -explain (costs off) select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_c.t1.c2 - -> Vector Sort - Sort Key: inlist2join_c.t1.c2 - -> Vector Sonic Hash Aggregate - Group By Key: inlist2join_c.t1.c2 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Nest Loop Semi Join - Join Filter: (inlist2join_c.t1.c1 = "*VALUES*".column1) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> Vector Materialize - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" -(19 rows) - -select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; - c2 | count -----+------- - 1 | 1 - 3 | 1 + col_int TINYINT + ,col_int2 SMALLINT + ,col_int4 INTEGER + ,col_int8 BIGINT + ,col_char CHAR(20) + ,col_varchar VARCHAR(30) + ,col_num DECIMAL(10,2) + ,col_num2 NUMERIC(10,4) + ,col_float FLOAT4 + ,col_float2 FLOAT8 + ,col_float3 FLOAT(3) + ,col_float4 BINARY_DOUBLE + ,col_float5 DECIMAL(10,4) + ,col_float6 INTEGER(6,3) + ,col_bool BOOLEAN + ,col_text TEXT +)with (orientation=column); +insert into type values +(0, 5 , 193540, 1935401906, 'aabccd', 'aabccd', 1.20 , 10.0000, null , 1.1 , 10.1234, 321.321, 123.123654, 123.123654, true,'aabccd'), +(1, 6 , 134597, 1345971420, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), +(2, 7 , 656473, 656473370 , 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 124.123654, 123.123654, true , 'aabccd'), +(3, 8 , 126971, 1269710788, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), +(4, 9 , 115677, 1156776517, 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 123.123654, 124.123654, true , 'aabccd'), +(5, 10, 128901, 1289013296, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, true , 'abccd' ); +select col_int from type where col_int in (1,2) order by 1; + col_int +--------- + 1 + 2 (2 rows) -explain (costs off) select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; - QUERY PLAN ---------------------------------------------------------------------------------------------- +explain (costs off) select col_int from type where col_int in (1,2) order by 1; + QUERY PLAN +---------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: t1.c3, t1.c2 - -> Vector Sort - Sort Key: t1.c3, t1.c2 - -> Vector Nest Loop Semi Join - Join Filter: (t1.c2 = inlist2join_c.t2.c2) - -> Vector Streaming(type: REDISTRIBUTE) - -> CStore Scan on t1 - Filter: (c1 > 1) - -> Vector Materialize - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t2.c1 = "*VALUES*".column1) - -> CStore Scan on t2 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" -(18 rows) - -select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; - c3 | c2 -----+---- - 3 | 3 - 4 | 4 - 5 | 5 - 6 | 6 - 7 | 7 + -> Vector Sort + Sort Key: col_int + -> CStore Scan on type + Filter: ((col_int)::bigint = ANY ('{1,2}'::integer[])) (5 rows) -select t1.c2, sum(t1.c3) from t1 where t1.c1 in (1,2,3) group by t1.c2 order by t1.c2 limit 2; - c2 | sum -----+----- - 1 | 1 - 2 | 2 +select col_int2 from type where col_int2 in (5,10) order by 1; + col_int2 +---------- + 5 + 10 (2 rows) -select max(t1.c2) from t1 where t1.c1 < 4 and t1.c1 in (2,3,4); - max ------ - 3 +explain (costs off) select col_int2 from type where col_int2 in (5,10) order by 1; + QUERY PLAN +-------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_int2 + -> CStore Scan on type + Filter: (col_int2 = ANY ('{5,10}'::integer[])) +(5 rows) + +select col_int4 from type where col_int4 in (134597, 134597) order by 1; + col_int4 +---------- + 134597 (1 row) -select t1.c2, t2.c3, count(*) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2; - c2 | c3 | count -----+----+------- - 1 | 1 | 1 - 2 | 2 | 1 - 3 | 3 | 1 -(3 rows) - -select t1.c2, t2.c3, sum(t1.c3) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2 limit 2; - c2 | c3 | sum -----+----+----- - 1 | 1 | 1 - 2 | 2 | 2 -(2 rows) - -select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2) as dt order by 1; - c1 | c2 | c3 -----+----+---- - 1 | 1 | 1 - 1 | 1 | 1 - 2 | 2 | 2 - 3 | 3 | 3 - 4 | 4 | 4 - 4 | 4 | 4 - 5 | 5 | 5 - 6 | 6 | 6 - 7 | 7 | 7 - 8 | 8 | 8 - 9 | 9 | 9 - 10 | 10 | 10 - 11 | 11 | 11 -(13 rows) - -select * from (select * from t1 union all select * from t2 where t2.c1 in (1,4,11)) as dt order by 1; - c1 | c2 | c3 -----+----+---- - 1 | 1 | 1 - 1 | 1 | 1 - 2 | 2 | 2 - 3 | 3 | 3 - 4 | 4 | 4 - 4 | 4 | 4 - 5 | 5 | 5 - 6 | 6 | 6 - 7 | 7 | 7 - 8 | 8 | 8 - 9 | 9 | 9 - 10 | 10 | 10 - 11 | 11 | 11 - 12 | 12 | 12 -(14 rows) - -select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2 where t2.c1 in (2,3)) as dt order by 1; - c1 | c2 | c3 -----+----+---- - 1 | 1 | 1 - 2 | 2 | 2 - 3 | 3 | 3 - 4 | 4 | 4 - 11 | 11 | 11 +explain (costs off) select col_int4 from type where col_int4 in (134597, 134597) order by 1; + QUERY PLAN +----------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_int4 + -> CStore Scan on type + Filter: (col_int4 = ANY ('{134597,134597}'::integer[])) (5 rows) ---测试expression inlist场景 --- allow for inlist2join -explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; +select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; + col_int8 +------------ + 1156776517 + 1345971420 +(2 rows) + +explain (costs off) select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; + QUERY PLAN +------------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_int8 + -> CStore Scan on type + Filter: (col_int8 = ANY ('{1345971420,1156776517}'::bigint[])) +(5 rows) + +select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; + col_char +---------------------- + aabccd + aabccd + aabccd +(3 rows) + +explain (costs off) select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; + QUERY PLAN +-------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_char + -> CStore Scan on type + Filter: (col_char = ANY ('{aabccd,aabccd,aab}'::bpchar[])) +(5 rows) + +select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; + col_varchar +------------- + abccd + abccd + abccd +(3 rows) + +explain (costs off) select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; + QUERY PLAN +------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_varchar + -> CStore Scan on type + Filter: ((col_varchar)::text = ANY ('{abccd,abc,aac}'::text[])) +(5 rows) + +select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; + col_num +--------- + 1.20 + 1.20 + 1.20 + 11.18 + 11.18 + 11.18 +(6 rows) + +explain (costs off) select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; + QUERY PLAN +--------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_num + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_num = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(10 rows) + +select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; + col_num2 +---------- + 1.1181 + 1.1181 + 1.1181 + 10.0000 + 10.0000 + 10.0000 +(6 rows) + +explain (costs off) select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; + QUERY PLAN +------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_num2 + -> CStore Scan on type + Filter: (col_num2 = ANY ('{1.1181,10.0000}'::numeric[])) +(5 rows) + +select col_float from type where col_float in (1.1, 55.555) order by 1; + col_float +----------- +(0 rows) + +explain (costs off) select col_float from type where col_float in (1.1, 55.555) order by 1; + QUERY PLAN +------------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_float + -> CStore Scan on type + Filter: (col_float = ANY ('{1.1,55.555}'::double precision[])) +(5 rows) + +select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; + col_float2 +------------ + 1.1 + 1.1 + 1.1 +(3 rows) + +explain (costs off) select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; + QUERY PLAN +---------------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_float2 + -> CStore Scan on type + Filter: (col_float2 = ANY ('{10.1234,1.1,11.2222}'::double precision[])) +(5 rows) + +select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; + col_float3 +------------ +(0 rows) + +explain (costs off) select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; + QUERY PLAN +------------------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float3 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float3 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(10 rows) + +select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; + col_float4 +------------ + 321.321 + 321.321 + 321.321 + 321.321 + 321.321 + 321.321 +(6 rows) + +explain (costs off) select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; + QUERY PLAN +------------------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_float4 + -> CStore Scan on type + Filter: (col_float4 = ANY ('{321.321,500.123}'::double precision[])) +(5 rows) + +select col_float5 from type where col_float5 in (123.123654, 123.1237) order by 1; + col_float5 +------------ + 123.1237 + 123.1237 + 123.1237 + 123.1237 + 123.1237 +(5 rows) + +explain (costs off) select col_float5 from type where col_float5 in (123.123654,123.1237) order by 1; + QUERY PLAN +------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_float5 + -> CStore Scan on type + Filter: (col_float5 = ANY ('{123.123654,123.1237}'::numeric[])) +(5 rows) + +select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; + col_float6 +------------ + 123.124 + 123.124 + 123.124 + 123.124 + 123.124 +(5 rows) + +explain (costs off) select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; + QUERY PLAN +------------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_float6 + -> CStore Scan on type + Filter: (col_float6 = ANY ('{123.124,113.123654}'::numeric[])) +(5 rows) + +select col_bool from type where col_bool in (true, false) order by 1; + col_bool +---------- + f + f + t + t + t + t +(6 rows) + +explain (costs off) select col_bool from type where col_bool in (true, false) order by 1; + QUERY PLAN +------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_bool + -> CStore Scan on type + Filter: (col_bool = ANY ('{t,f}'::boolean[])) +(5 rows) + +select col_text from type where col_text in ('abccd', 'aab') order by 1; + col_text +---------- + abccd + abccd + abccd +(3 rows) + +explain (costs off) select col_text from type where col_text in ('abccd', 'aab') order by 1; + QUERY PLAN +---------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_text + -> CStore Scan on type + Filter: (col_text = ANY ('{abccd,aab}'::text[])) +(5 rows) + +CREATE TABLE time +( + col_int int + ,col_date date + ,col_timestamp timestamp + ,col_timestamptz timestamptz + ,col_smalldatetime smalldatetime + ,col_char char + ,col_interval interval + ,col_time time + ,col_timetz timetz + ,col_tinterval tinterval +)with (orientation=column); +COPY time(col_int, col_date, col_timestamp, col_timestamptz, col_smalldatetime, col_char, col_interval, col_time, col_timetz, col_tinterval) FROM stdin; +select col_char from time where col_char in ('a', 'd') order by 1; + col_char +---------- + a + d +(2 rows) + +explain (costs off) select col_char from time where col_char in ('a', 'd') order by 1; + QUERY PLAN +------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_char + -> CStore Scan on "time" + Filter: (col_char = ANY ('{a,d}'::bpchar[])) +(5 rows) + +select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; + col_date +-------------------------- + Tue Nov 01 00:00:00 2011 + Tue Nov 01 00:00:00 2011 + Fri Nov 02 00:00:00 2012 + Fri Nov 02 00:00:00 2012 +(4 rows) + +explain (costs off) select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_date + -> CStore Scan on "time" + Filter: (col_date = ANY ('{"Tue Nov 01 00:00:00 2011","Fri Nov 02 00:00:00 2012"}'::timestamp without time zone[])) +(5 rows) + +select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; + col_timestamp +-------------------------- + Sat Sep 09 19:45:37 2017 +(1 row) + +explain (costs off) select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_timestamp + -> CStore Scan on "time" + Filter: (col_timestamp = ANY ('{"Sat Sep 09 19:45:37 2017","Sat Sep 09 19:45:37 2017"}'::timestamp without time zone[])) +(5 rows) + +select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; + col_timestamptz +------------------------------ + Sat Sep 09 19:45:37 2017 PDT +(1 row) + +explain (costs off) select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: col_timestamptz + -> CStore Scan on "time" + Filter: (col_timestamptz = ANY ('{"Sat Sep 09 19:45:37 2017 PDT","Sat Sep 09 19:45:37 2017 PDT"}'::timestamp with time zone[])) +(5 rows) + +select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; + col_smalldatetime +-------------------------- + Sat Apr 12 04:05:00 2003 + Sat Apr 12 04:05:00 2003 + Sat Apr 12 04:05:00 2003 + Sat Apr 12 04:05:00 2003 +(4 rows) + +explain (costs off) select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------ + Row Adapter + -> Vector Sort + Sort Key: col_smalldatetime + -> CStore Scan on "time" + Filter: (col_smalldatetime = ANY ('{"Sat Sep 09 19:46:00 2017","Sat Apr 12 04:05:00 2003"}'::smalldatetime[])) +(5 rows) + +select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; + col_time +---------- + 08:00:30 +(1 row) + +explain (costs off) select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; QUERY PLAN --------------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_c.t1.c1 - -> Vector Sort - Sort Key: inlist2join_c.t1.c1 - -> Vector Nest Loop - Join Filter: (inlist2join_c.t1.c1 = inlist2join_c.t2.c1) - -> Vector Hash Semi Join - Hash Cond: ((inlist2join_c.t1.c1 + 2) = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> Vector Materialize - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Hash Semi Join - Hash Cond: ((inlist2join_c.t2.c1 + 2) = "*VALUES*".column1) - -> CStore Scan on t2 - -> Vector Adapter - -> Values Scan on "*VALUES*" -(19 rows) + -> Vector Sort + Sort Key: col_time + -> CStore Scan on "time" + Filter: (col_time = ANY ('{08:00:30,00:00:30,12:00:30}'::time without time zone[])) +(5 rows) -select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; - c1 | c1 -----+---- - 1 | 1 - 2 | 2 - 3 | 3 -(3 rows) +select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; + col_timetz +------------- + 08:00:30+08 +(1 row) -explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 * 2) in (1,2,3,4,5) order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------- +explain (costs off) select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; + QUERY PLAN +----------------------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_c.t1.c1 - -> Vector Sort - Sort Key: inlist2join_c.t1.c1 - -> Vector Nest Loop - Join Filter: (inlist2join_c.t1.c1 = t2.c1) - -> Vector Hash Semi Join - Hash Cond: ((inlist2join_c.t1.c2 * 2) = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> CStore Scan on t2 -(13 rows) + -> Vector Sort + Sort Key: col_timetz + -> CStore Scan on "time" + Filter: (col_timetz = ANY ('{08:00:30+08,00:00:30+08,12:00:30+08}'::time with time zone[])) +(5 rows) -select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 *2) in (1,2,3,4,5) order by 1; - c1 | c1 -----+---- - 1 | 1 - 2 | 2 +select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; + col_interval +----------------------------------- + @ 1 day 18 hours 34 mins 56 secs + @ 2 days 13 hours 34 mins 56 secs (2 rows) --- disallow for inlistjoin -explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t1.c2) in (1,2,3,4,5) order by 1; - QUERY PLAN --------------------------------------------------------------------------------- +explain (costs off) select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: t1.c1 - -> Vector Sort - Sort Key: t1.c1 - -> Vector Nest Loop - Join Filter: (t1.c1 = t2.c1) - -> CStore Scan on t1 - Filter: ((c1 + c2) = ANY ('{1,2,3,4,5}'::integer[])) - -> CStore Scan on t2 -(10 rows) + -> Vector Sort + Sort Key: col_interval + -> CStore Scan on "time" + Filter: (col_interval = ANY ('{"@ 2 days 13 hours 34 mins 56 secs","@ 1 day 18 hours 34 mins 56 secs"}'::interval[])) +(5 rows) -select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t2.c2) in (1,2,3,4,5) order by 1; - c1 | c1 -----+---- - 1 | 1 - 2 | 2 +select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; + col_tinterval +----------------------------------------------------------------- + ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] + ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] (2 rows) --- --- forbid inlist2join query rewrite if there's subplan -set qrw_inlist2join_optmode=1; -create table t3(c1 int, c2 int, c3 int) distribute by hash(c1); -insert into t3 select v,v,v from generate_series(1,10) as v; --- the sublink can be pull up, so there is no subpaln, do inlist2join -explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 > 2) AND t1.c2 in (1,2,3); - QUERY PLAN ---------------------------------------------------------------------------- +explain (costs off) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - -> Vector Nest Loop Semi Join - Join Filter: (inlist2join_c.t1.c1 = t2.c1) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> Vector Materialize - -> CStore Scan on t2 - Filter: (c2 > 2) -(12 rows) + -> Vector Sort + Sort Key: col_tinterval + -> CStore Scan on "time" + Filter: (col_tinterval = ANY ('{"[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]","[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]"}'::tinterval[])) +(5 rows) -explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 = t1.c1) and t1.c1 in (1,2,3); - QUERY PLAN ---------------------------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - -> Vector Nest Loop Semi Join - Join Filter: (inlist2join_c.t1.c1 = inlist2join_c.t2.c2) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) - -> CStore Scan on t1 - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Adapter - -> Values Scan on "*VALUES*" - -> Vector Materialize - -> Vector Streaming(type: REDISTRIBUTE) - -> Vector Hash Semi Join - Hash Cond: (inlist2join_c.t2.c2 = "*VALUES*".column1) - -> CStore Scan on t2 - -> Vector Adapter - -> Values Scan on "*VALUES*" -(17 rows) - -explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2>2) and t1.c3 in (1,2,3); - QUERY PLAN ----------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop Anti Join - Join Filter: ((inlist2join_c.t1.c1 = t3.c2) OR (inlist2join_c.t1.c1 IS NULL) OR (t3.c2 IS NULL)) - -> Nested Loop - Join Filter: (inlist2join_c.t1.c1 = t2.c1) - -> Hash Semi Join - Hash Cond: (inlist2join_c.t1.c3 = "*VALUES*".column1) - -> Row Adapter - -> CStore Scan on t1 - -> Hash - -> Values Scan on "*VALUES*" - -> Row Adapter - -> CStore Scan on t2 - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on t3 - Filter: (c2 > 2) -(17 rows) - --- the sublink can not be pull up, so there is subpaln, do not inlist2join -explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 = t1.c2) AND t1.c2 in (1,2,3); - QUERY PLAN ---------------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - -> CStore Scan on t1 - Filter: ((c2 = ANY ('{1,2,3}'::integer[])) AND (SubPlan 1)) - SubPlan 1 - -> Row Adapter - -> Vector Result - Filter: (t2.c2 = t1.c2) - -> Vector Materialize - -> Vector Streaming(type: BROADCAST) - -> CStore Scan on t2 -(11 rows) - -explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 > 2) and t1.c1 in (1,2,3); - QUERY PLAN ---------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - InitPlan 1 (returns $0) - -> Row Adapter - -> Vector Streaming(type: BROADCAST) - -> CStore Scan on t2 - Filter: (c2 > 2) - -> Vector Result - One-Time Filter: $0 - -> CStore Scan on t1 - Filter: (c1 = ANY ('{1,2,3}'::integer[])) -(11 rows) - -explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2=t1.c2) and t1.c3 in (1,2,3); - QUERY PLAN ---------------------------------------------------------------------------------------- - Row Adapter - -> Vector Streaming (type: GATHER) - -> Vector Nest Loop - Join Filter: (t1.c1 = t2.c1) - -> CStore Scan on t1 - Filter: ((c3 = ANY ('{1,2,3}'::integer[])) AND (NOT (SubPlan 1))) - SubPlan 1 - -> Result - Filter: (t3.c2 = t1.c2) - -> Materialize - -> Streaming(type: BROADCAST) - -> Seq Scan on t3 - -> CStore Scan on t2 -(13 rows) - --- -drop table t1; -drop table t2; -drop table t3; -drop schema inlist2join_c cascade; +drop schema inlist2join_type_c cascade; +NOTICE: drop cascades to 2 other objects +DETAIL: drop cascades to table type +drop cascades to table "time" diff --git a/src/test/regress/expected/inlist2join_type.out b/src/test/regress/expected/inlist2join_type.out index 6a61620ca..76784de62 100644 --- a/src/test/regress/expected/inlist2join_type.out +++ b/src/test/regress/expected/inlist2join_type.out @@ -1,594 +1,491 @@ -create schema inlist2join_type; -set current_schema=inlist2join_type; -set qrw_inlist2join_optmode = 1; -create table type +create schema inlist2join_c; +set current_schema=inlist2join_c; +set qrw_inlist2join_optmode=1; +create table t1(c1 int, c2 int, c3 int) with (orientation=column); +insert into t1 select v,v,v from generate_series(1,12) as v; +create table t2(c1 int, c2 int, c3 int) with (orientation=column); +insert into t2 select v,v,v from generate_series(1,10) as v; +explain (costs off) select c1,c2 from t1 where t1.c2 in (3,4,7); + QUERY PLAN +--------------------------------------------------------------- + Row Adapter + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(8 rows) + +select c1,c2 from t1 where t1.c2 in (3,4,7) order by 1; + c1 | c2 +----+---- + 3 | 3 + 4 | 4 + 7 | 7 +(3 rows) + +explain (costs off) select c1,c3 from t1 where t1.c2 in (3,4,7); + QUERY PLAN +--------------------------------------------------------------- + Row Adapter + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(8 rows) + +select c1,c3 from t1 where t1.c3 in (3,4,7) order by 1; + c1 | c3 +----+---- + 3 | 3 + 4 | 4 + 7 | 7 +(3 rows) + +explain (costs off) select c2,c3 from t1 where t1.c2 in (3,4,7); + QUERY PLAN +--------------------------------------------------------------- + Row Adapter + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(8 rows) + +select c2,c3 from t1 where t1.c3 in (3,4,7) order by 1; + c2 | c3 +----+---- + 3 | 3 + 4 | 4 + 7 | 7 +(3 rows) + +explain (costs off) select t1.c1 as c1, t2.c2 as c2 +from t1,t2 +where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) +order by 1,2; + QUERY PLAN +--------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = inlist2join_c.t2.c1) + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t2.c1 = "*VALUES*".column1) + -> CStore Scan on t2 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(19 rows) + +select t1.c1 as c1, t2.c2 as c2 +from t1,t2 +where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) +order by 1,2; + c1 | c2 +----+---- + 3 | 3 + 4 | 4 + 5 | 5 + 6 | 6 +(4 rows) + +explain (costs off) select * from ( - col_int TINYINT - ,col_int2 SMALLINT - ,col_int4 INTEGER - ,col_int8 BIGINT - ,col_char CHAR(20) - ,col_varchar VARCHAR(30) - ,col_num DECIMAL(10,2) - ,col_num2 NUMERIC(10,4) - ,col_float FLOAT4 - ,col_float2 FLOAT8 - ,col_float3 FLOAT(3) - ,col_float4 BINARY_DOUBLE - ,col_float5 DECIMAL(10,4) - ,col_float6 INTEGER(6,3) - ,col_bool BOOLEAN - ,col_text TEXT -)distribute by hash(col_int); -insert into type values -(0, 5 , 193540, 1935401906, 'aabccd', 'aabccd', 1.20 , 10.0000, null , 1.1 , 10.1234, 321.321, 123.123654, 123.123654, true,'aabccd'), -(1, 6 , 134597, 1345971420, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), -(2, 7 , 656473, 656473370 , 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 124.123654, 123.123654, true , 'aabccd'), -(3, 8 , 126971, 1269710788, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), -(4, 9 , 115677, 1156776517, 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 123.123654, 124.123654, true , 'aabccd'), -(5, 10, 128901, 1289013296, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, true , 'abccd' ); -select col_int from type where col_int in (1,2) order by 1; - col_int ---------- - 1 - 2 -(2 rows) - -explain (costs off) select col_int from type where col_int in (1,2) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_int - -> Sort - Sort Key: inlist2join_type.type.col_int - -> Hash Semi Join - Hash Cond: ((inlist2join_type.type.col_int)::bigint = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Streaming(type: REDISTRIBUTE) - -> Values Scan on "*VALUES*" -(10 rows) - -select col_int2 from type where col_int2 in (5,10) order by 1; - col_int2 ----------- - 5 - 10 -(2 rows) - -explain (costs off) select col_int2 from type where col_int2 in (5,10) order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_int2 - -> Sort - Sort Key: inlist2join_type.type.col_int2 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_int2 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_int4 from type where col_int4 in (134597, 134597) order by 1; - col_int4 ----------- - 134597 -(1 row) - -explain (costs off) select col_int4 from type where col_int4 in (134597, 134597) order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_int4 - -> Sort - Sort Key: inlist2join_type.type.col_int4 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_int4 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; - col_int8 ------------- - 1156776517 - 1345971420 -(2 rows) - -explain (costs off) select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_int8 - -> Sort - Sort Key: inlist2join_type.type.col_int8 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_int8 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; - col_char ----------------------- - aabccd - aabccd - aabccd -(3 rows) - -explain (costs off) select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_char - -> Sort - Sort Key: inlist2join_type.type.col_char - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_char = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; - col_varchar -------------- - abccd - abccd - abccd -(3 rows) - -explain (costs off) select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_varchar - -> Sort - Sort Key: inlist2join_type.type.col_varchar - -> Hash Semi Join - Hash Cond: ((inlist2join_type.type.col_varchar)::text = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; - col_num ---------- - 1.20 - 1.20 - 1.20 - 11.18 - 11.18 - 11.18 -(6 rows) - -explain (costs off) select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; - QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_num - -> Sort - Sort Key: inlist2join_type.type.col_num - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_num = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; - col_num2 ----------- - 1.1181 - 1.1181 - 1.1181 - 10.0000 - 10.0000 - 10.0000 -(6 rows) - -explain (costs off) select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_num2 - -> Sort - Sort Key: inlist2join_type.type.col_num2 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_num2 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_float from type where col_float in (1.1, 55.555) order by 1; - col_float ------------ -(0 rows) - -explain (costs off) select col_float from type where col_float in (1.1, 55.555) order by 1; + select t1.c1 as c1, t2.c2 as c2, count(*) as sum + from t1,t2 + where t1.c1 = t2.c1 + group by 1,2 +) as dt where dt.c1 in (3,4,5,6) +order by 1,2,3; QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_float - -> Sort - Sort Key: inlist2join_type.type.col_float - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_float = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) + Row Adapter + -> Vector Sort + Sort Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2, (count(*)) + -> Vector Sonic Hash Aggregate + Group By Key: inlist2join_c.t1.c1, inlist2join_c.t2.c2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = inlist2join_c.t2.c1) + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t2.c1 = "*VALUES*".column1) + -> CStore Scan on t2 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(21 rows) -select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; - col_float2 ------------- - 1.1 - 1.1 - 1.1 -(3 rows) - -explain (costs off) select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_float2 - -> Sort - Sort Key: inlist2join_type.type.col_float2 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_float2 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; - col_float3 ------------- -(0 rows) - -explain (costs off) select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_float3 - -> Sort - Sort Key: inlist2join_type.type.col_float3 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_float3 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; - col_float4 ------------- - 321.321 - 321.321 - 321.321 - 321.321 - 321.321 - 321.321 -(6 rows) - -explain (costs off) select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_float4 - -> Sort - Sort Key: inlist2join_type.type.col_float4 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_float4 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_float5 from type where col_float5 in (123.123654, 123.1237) order by 1; - col_float5 ------------- - 123.1237 - 123.1237 - 123.1237 - 123.1237 - 123.1237 -(5 rows) - -explain (costs off) select col_float5 from type where col_float5 in (123.123654,123.1237) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_float5 - -> Sort - Sort Key: inlist2join_type.type.col_float5 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_float5 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; - col_float6 ------------- - 123.124 - 123.124 - 123.124 - 123.124 - 123.124 -(5 rows) - -explain (costs off) select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_float6 - -> Sort - Sort Key: inlist2join_type.type.col_float6 - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_float6 = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_bool from type where col_bool in (true, false) order by 1; - col_bool ----------- - f - f - t - t - t - t -(6 rows) - -explain (costs off) select col_bool from type where col_bool in (true, false) order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_bool - -> Sort - Sort Key: inlist2join_type.type.col_bool - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_bool = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_text from type where col_text in ('abccd', 'aab') order by 1; - col_text ----------- - abccd - abccd - abccd -(3 rows) - -explain (costs off) select col_text from type where col_text in ('abccd', 'aab') order by 1; - QUERY PLAN --------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type.type.col_text - -> Sort - Sort Key: inlist2join_type.type.col_text - -> Hash Semi Join - Hash Cond: (inlist2join_type.type.col_text = "*VALUES*".column1) - -> Seq Scan on type - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -CREATE TABLE time -( - col_int int - ,col_date date - ,col_timestamp timestamp - ,col_timestamptz timestamptz - ,col_smalldatetime smalldatetime - ,col_char char - ,col_interval interval - ,col_time time - ,col_timetz timetz - ,col_tinterval tinterval -)distribute by hash(col_int); -COPY time(col_int, col_date, col_timestamp, col_timestamptz, col_smalldatetime, col_char, col_interval, col_time, col_timetz, col_tinterval) FROM stdin; -select col_char from time where col_char in ('a', 'd') order by 1; - col_char ----------- - a - d -(2 rows) - -explain (costs off) select col_char from time where col_char in ('a', 'd') order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_char - -> Sort - Sort Key: inlist2join_type."time".col_char - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_char = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; - col_date --------------------------- - Tue Nov 01 00:00:00 2011 - Tue Nov 01 00:00:00 2011 - Fri Nov 02 00:00:00 2012 - Fri Nov 02 00:00:00 2012 +select * from +( + select t1.c1 as c1, t2.c2 as c2, count(*) as sum + from t1,t2 + where t1.c1 = t2.c1 + group by 1,2 +) as dt where dt.c1 in (3,4,5,6) +order by 1,2,3; + c1 | c2 | sum +----+----+----- + 3 | 3 | 1 + 4 | 4 | 1 + 5 | 5 | 1 + 6 | 6 | 1 (4 rows) -explain (costs off) select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_date - -> Sort - Sort Key: inlist2join_type."time".col_date - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_date = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) +explain (costs off) select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; + QUERY PLAN +--------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort Aggregate + Group By Key: inlist2join_c.t1.c2 + -> Vector Sort + Sort Key: inlist2join_c.t1.c2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(19 rows) -select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; - col_timestamp --------------------------- - Sat Sep 09 19:45:37 2017 -(1 row) - -explain (costs off) select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_timestamp - -> Sort - Sort Key: inlist2join_type."time".col_timestamp - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_timestamp = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; - col_timestamptz ------------------------------- - Sat Sep 09 19:45:37 2017 PDT -(1 row) - -explain (costs off) select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_timestamptz - -> Sort - Sort Key: inlist2join_type."time".col_timestamptz - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_timestamptz = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; - col_smalldatetime --------------------------- - Sat Apr 12 04:05:00 2003 - Sat Apr 12 04:05:00 2003 - Sat Apr 12 04:05:00 2003 - Sat Apr 12 04:05:00 2003 -(4 rows) - -explain (costs off) select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_smalldatetime - -> Sort - Sort Key: inlist2join_type."time".col_smalldatetime - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_smalldatetime = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; - col_time ----------- - 08:00:30 -(1 row) - -explain (costs off) select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_time - -> Sort - Sort Key: inlist2join_type."time".col_time - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_time = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; - col_timetz -------------- - 08:00:30+08 -(1 row) - -explain (costs off) select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_timetz - -> Sort - Sort Key: inlist2join_type."time".col_timetz - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_timetz = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) - -select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; - col_interval ------------------------------------ - @ 1 day 18 hours 34 mins 56 secs - @ 2 days 13 hours 34 mins 56 secs +select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; + c2 | count +----+------- + 1 | 1 + 3 | 1 (2 rows) -explain (costs off) select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; - QUERY PLAN --------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_interval - -> Sort - Sort Key: inlist2join_type."time".col_interval - -> Hash Semi Join - Hash Cond: (inlist2join_type."time".col_interval = "*VALUES*".column1) - -> Seq Scan on "time" - -> Hash - -> Values Scan on "*VALUES*" -(9 rows) +explain (costs off) select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; + QUERY PLAN +--------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: t1.c3, t1.c2 + -> Vector Sonic Hash Join + Hash Cond: (t1.c2 = inlist2join_c.t2.c2) + -> CStore Scan on t1 + Filter: (c1 > 1) + -> Vector Sonic Hash Aggregate + Group By Key: inlist2join_c.t2.c2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t2.c1 = "*VALUES*".column1) + -> CStore Scan on t2 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(16 rows) -select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; - col_tinterval ------------------------------------------------------------------ - ["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"] - ["Sat May 10 23:59:12 1947 PST" "Sun Jan 14 03:14:21 1973 PST"] +select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; + c3 | c2 +----+---- + 3 | 3 + 4 | 4 + 5 | 5 + 6 | 6 + 7 | 7 +(5 rows) + +select t1.c2, sum(t1.c3) from t1 where t1.c1 in (1,2,3) group by t1.c2 order by t1.c2 limit 2; + c2 | sum +----+----- + 1 | 1 + 2 | 2 (2 rows) -explain (costs off) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: inlist2join_type."time".col_tinterval - -> Sort - Sort Key: inlist2join_type."time".col_tinterval - -> Nested Loop Semi Join - Join Filter: (inlist2join_type."time".col_tinterval = "*VALUES*".column1) - -> Seq Scan on "time" +select max(t1.c2) from t1 where t1.c1 < 4 and t1.c1 in (2,3,4); + max +----- + 3 +(1 row) + +select t1.c2, t2.c3, count(*) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2; + c2 | c3 | count +----+----+------- + 1 | 1 | 1 + 2 | 2 | 1 + 3 | 3 | 1 +(3 rows) + +select t1.c2, t2.c3, sum(t1.c3) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2 limit 2; + c2 | c3 | sum +----+----+----- + 1 | 1 | 1 + 2 | 2 | 2 +(2 rows) + +select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2) as dt order by 1; + c1 | c2 | c3 +----+----+---- + 1 | 1 | 1 + 1 | 1 | 1 + 2 | 2 | 2 + 3 | 3 | 3 + 4 | 4 | 4 + 4 | 4 | 4 + 5 | 5 | 5 + 6 | 6 | 6 + 7 | 7 | 7 + 8 | 8 | 8 + 9 | 9 | 9 + 10 | 10 | 10 + 11 | 11 | 11 +(13 rows) + +select * from (select * from t1 union all select * from t2 where t2.c1 in (1,4,11)) as dt order by 1; + c1 | c2 | c3 +----+----+---- + 1 | 1 | 1 + 1 | 1 | 1 + 2 | 2 | 2 + 3 | 3 | 3 + 4 | 4 | 4 + 4 | 4 | 4 + 5 | 5 | 5 + 6 | 6 | 6 + 7 | 7 | 7 + 8 | 8 | 8 + 9 | 9 | 9 + 10 | 10 | 10 + 11 | 11 | 11 + 12 | 12 | 12 +(14 rows) + +select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2 where t2.c1 in (2,3)) as dt order by 1; + c1 | c2 | c3 +----+----+---- + 1 | 1 | 1 + 2 | 2 | 2 + 3 | 3 | 3 + 4 | 4 | 4 + 11 | 11 | 11 +(5 rows) + +--测试expression inlist场景 +-- allow for inlist2join +explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; + QUERY PLAN +--------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: inlist2join_c.t1.c1 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = inlist2join_c.t2.c1) + -> Vector Sonic Hash Join + Hash Cond: ((inlist2join_c.t1.c1 + 2) = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" + -> Vector Sonic Hash Join + Hash Cond: ((inlist2join_c.t2.c1 + 2) = "*VALUES*".column1) + -> CStore Scan on t2 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(19 rows) + +select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; + c1 | c1 +----+---- + 1 | 1 + 2 | 2 + 3 | 3 +(3 rows) + +explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 * 2) in (1,2,3,4,5) order by 1; + QUERY PLAN +--------------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: inlist2join_c.t1.c1 + -> Vector Sonic Hash Join + Hash Cond: (t2.c1 = inlist2join_c.t1.c1) + -> CStore Scan on t2 + -> Vector Sonic Hash Join + Hash Cond: ((inlist2join_c.t1.c2 * 2) = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(13 rows) + +select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 *2) in (1,2,3,4,5) order by 1; + c1 | c1 +----+---- + 1 | 1 + 2 | 2 +(2 rows) + +-- disallow for inlistjoin +explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t1.c2) in (1,2,3,4,5) order by 1; + QUERY PLAN +-------------------------------------------------------------------------- + Row Adapter + -> Vector Sort + Sort Key: t1.c1 + -> Vector Sonic Hash Join + Hash Cond: (t2.c1 = t1.c1) + -> CStore Scan on t2 + -> CStore Scan on t1 + Filter: ((c1 + c2) = ANY ('{1,2,3,4,5}'::integer[])) +(8 rows) + +select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t2.c2) in (1,2,3,4,5) order by 1; + c1 | c1 +----+---- + 1 | 1 + 2 | 2 +(2 rows) + +-- +-- forbid inlist2join query rewrite if there's subplan +set qrw_inlist2join_optmode=1; +create table t3(c1 int, c2 int, c3 int); +insert into t3 select v,v,v from generate_series(1,10) as v; +-- the sublink can be pull up, so there is no subpaln, do inlist2join +explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 > 2) AND t1.c2 in (1,2,3); + QUERY PLAN +--------------------------------------------------------------------- + Row Adapter + -> Vector Hash Right Semi Join + Hash Cond: (t2.c1 = inlist2join_c.t1.c1) + -> CStore Scan on t2 + Filter: (c2 > 2) + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c2 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(12 rows) + +explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 = t1.c1) and t1.c1 in (1,2,3); + QUERY PLAN +--------------------------------------------------------------------------- + Row Adapter + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = inlist2join_c.t2.c2) + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t1.c1 = "*VALUES*".column1) + -> CStore Scan on t1 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" + -> Vector Sonic Hash Aggregate + Group By Key: inlist2join_c.t2.c2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_c.t2.c2 = "*VALUES*".column1) + -> CStore Scan on t2 + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(19 rows) + +explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2>2) and t1.c3 in (1,2,3); + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (t2.c1 = inlist2join_c.t1.c1) + -> Row Adapter + -> CStore Scan on t2 + -> Hash + -> Nested Loop Anti Join + Join Filter: ((inlist2join_c.t1.c1 = t3.c2) OR (inlist2join_c.t1.c1 IS NULL) OR (t3.c2 IS NULL)) + -> Hash Join + Hash Cond: (inlist2join_c.t1.c3 = "*VALUES*".column1) + -> Row Adapter + -> CStore Scan on t1 + -> Hash + -> HashAggregate + Group By Key: "*VALUES*".column1 + -> Values Scan on "*VALUES*" -> Materialize - -> Values Scan on "*VALUES*" + -> Seq Scan on t3 + Filter: (c2 > 2) +(18 rows) + +-- the sublink can not be pull up, so there is subpaln, do not inlist2join +explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 = t1.c2) AND t1.c2 in (1,2,3); + QUERY PLAN +--------------------------------------------------------------------- + Row Adapter + -> CStore Scan on t1 + Filter: ((c2 = ANY ('{1,2,3}'::integer[])) AND (SubPlan 1)) + SubPlan 1 + -> Row Adapter + -> CStore Scan on t2 + Filter: (c2 = t1.c2) +(7 rows) + +explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 > 2) and t1.c1 in (1,2,3); + QUERY PLAN +--------------------------------------------------------- + Row Adapter + -> Vector Result + One-Time Filter: $0 + InitPlan 1 (returns $0) + -> Row Adapter + -> CStore Scan on t2 + Filter: (c2 > 2) + -> CStore Scan on t1 + Filter: (c1 = ANY ('{1,2,3}'::integer[])) (9 rows) -drop schema inlist2join_type cascade; -NOTICE: drop cascades to 2 other objects -DETAIL: drop cascades to table type -drop cascades to table "time" +explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2=t1.c2) and t1.c3 in (1,2,3); + QUERY PLAN +--------------------------------------------------------------------------------- + Row Adapter + -> Vector Sonic Hash Join + Hash Cond: (t1.c1 = t2.c1) + -> CStore Scan on t1 + Filter: ((c3 = ANY ('{1,2,3}'::integer[])) AND (NOT (SubPlan 1))) + SubPlan 1 + -> Seq Scan on t3 + Filter: (c2 = t1.c2) + -> CStore Scan on t2 +(9 rows) + +-- +drop table t1; +drop table t2; +drop table t3; +drop schema inlist2join_c cascade; diff --git a/src/test/regress/expected/inlist2join_type_c.out b/src/test/regress/expected/inlist2join_type_c.out index eece14012..88850b29a 100644 --- a/src/test/regress/expected/inlist2join_type_c.out +++ b/src/test/regress/expected/inlist2join_type_c.out @@ -19,8 +19,7 @@ create table type ,col_float6 INTEGER(6,3) ,col_bool BOOLEAN ,col_text TEXT -)with (orientation=column) -distribute by hash(col_int); +)with (orientation=column); insert into type values (0, 5 , 193540, 1935401906, 'aabccd', 'aabccd', 1.20 , 10.0000, null , 1.1 , 10.1234, 321.321, 123.123654, 123.123654, true,'aabccd'), (1, 6 , 134597, 1345971420, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), @@ -36,17 +35,17 @@ select col_int from type where col_int in (1,2) order by 1; (2 rows) explain (costs off) select col_int from type where col_int in (1,2) order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_int - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_int - -> Vector Hash Semi Join - Hash Cond: ((inlist2join_type_c.type.col_int)::bigint = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Streaming(type: REDISTRIBUTE) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_int + -> Vector Sonic Hash Join + Hash Cond: ((inlist2join_type_c.type.col_int)::bigint = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (11 rows) @@ -59,19 +58,20 @@ select col_int2 from type where col_int2 in (5,10) order by 1; (2 rows) explain (costs off) select col_int2 from type where col_int2 in (5,10) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_int2 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_int2 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_int2 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_int2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_int2 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_int4 from type where col_int4 in (134597, 134597) order by 1; col_int4 @@ -80,19 +80,20 @@ select col_int4 from type where col_int4 in (134597, 134597) order by 1; (1 row) explain (costs off) select col_int4 from type where col_int4 in (134597, 134597) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_int4 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_int4 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_int4 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_int4 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_int4 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; col_int8 @@ -102,19 +103,20 @@ select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; (2 rows) explain (costs off) select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_int8 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_int8 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_int8 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_int8 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_int8 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; col_char @@ -125,16 +127,16 @@ select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by (3 rows) explain (costs off) select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_char - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_char - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_char = "*VALUES*".column1) - -> CStore Scan on type + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_char + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_char = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -148,16 +150,16 @@ select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order b (3 rows) explain (costs off) select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_varchar - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_varchar - -> Vector Hash Semi Join - Hash Cond: ((inlist2join_type_c.type.col_varchar)::text = "*VALUES*".column1) - -> CStore Scan on type + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_varchar + -> Vector Sonic Hash Join + Hash Cond: ((inlist2join_type_c.type.col_varchar)::text = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -174,16 +176,16 @@ select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; (6 rows) explain (costs off) select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_num - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_num - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_num = "*VALUES*".column1) - -> CStore Scan on type + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_num + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_num = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -200,19 +202,20 @@ select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; (6 rows) explain (costs off) select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_num2 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_num2 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_num2 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_num2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_num2 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_float from type where col_float in (1.1, 55.555) order by 1; col_float @@ -220,19 +223,20 @@ select col_float from type where col_float in (1.1, 55.555) order by 1; (0 rows) explain (costs off) select col_float from type where col_float in (1.1, 55.555) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_float - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_float - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_float = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; col_float2 @@ -243,16 +247,16 @@ select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by (3 rows) explain (costs off) select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_float2 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_float2 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_float2 = "*VALUES*".column1) - -> CStore Scan on type + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float2 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float2 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -263,16 +267,16 @@ select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2 (0 rows) explain (costs off) select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_float3 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_float3 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_float3 = "*VALUES*".column1) - -> CStore Scan on type + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float3 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float3 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -289,19 +293,20 @@ select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; (6 rows) explain (costs off) select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_float4 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_float4 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_float4 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float4 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float4 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_float5 from type where col_float5 in (123.123654, 123.1237) order by 1; col_float5 @@ -314,19 +319,20 @@ select col_float5 from type where col_float5 in (123.123654, 123.1237) order by (5 rows) explain (costs off) select col_float5 from type where col_float5 in (123.123654,123.1237) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_float5 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_float5 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_float5 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float5 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float5 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; col_float6 @@ -339,19 +345,20 @@ select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1 (5 rows) explain (costs off) select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_float6 - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_float6 - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_float6 = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_float6 + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_float6 = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_bool from type where col_bool in (true, false) order by 1; col_bool @@ -365,19 +372,17 @@ select col_bool from type where col_bool in (true, false) order by 1; (6 rows) explain (costs off) select col_bool from type where col_bool in (true, false) order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_bool - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_bool - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_bool = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_bool + -> Vector Hash Semi Join + Hash Cond: (inlist2join_type_c.type.col_bool = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Adapter + -> Values Scan on "*VALUES*" +(8 rows) select col_text from type where col_text in ('abccd', 'aab') order by 1; col_text @@ -388,19 +393,20 @@ select col_text from type where col_text in ('abccd', 'aab') order by 1; (3 rows) explain (costs off) select col_text from type where col_text in ('abccd', 'aab') order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c.type.col_text - -> Vector Sort - Sort Key: inlist2join_type_c.type.col_text - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c.type.col_text = "*VALUES*".column1) - -> CStore Scan on type - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c.type.col_text + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c.type.col_text = "*VALUES*".column1) + -> CStore Scan on type + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) CREATE TABLE time ( @@ -414,8 +420,7 @@ CREATE TABLE time ,col_time time ,col_timetz timetz ,col_tinterval tinterval -)with (orientation=column) -distribute by hash(col_int); +)with (orientation=column); COPY time(col_int, col_date, col_timestamp, col_timestamptz, col_smalldatetime, col_char, col_interval, col_time, col_timetz, col_tinterval) FROM stdin; select col_char from time where col_char in ('a', 'd') order by 1; col_char @@ -425,19 +430,20 @@ select col_char from time where col_char in ('a', 'd') order by 1; (2 rows) explain (costs off) select col_char from time where col_char in ('a', 'd') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_char - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_char - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_char = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_char + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_char = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; col_date @@ -449,19 +455,20 @@ select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 (4 rows) explain (costs off) select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_date - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_date - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_date = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_date + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_date = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; col_timestamp @@ -470,19 +477,20 @@ select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2 (1 row) explain (costs off) select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------------ + QUERY PLAN +----------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_timestamp - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_timestamp - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_timestamp = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_timestamp + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_timestamp = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; col_timestamptz @@ -491,19 +499,20 @@ select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37' (1 row) explain (costs off) select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_timestamptz - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_timestamptz - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_timestamptz = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_timestamptz + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_timestamptz = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; col_smalldatetime @@ -515,19 +524,20 @@ select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45 (4 rows) explain (costs off) select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; - QUERY PLAN ---------------------------------------------------------------------------------------------------- + QUERY PLAN +--------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_smalldatetime - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_smalldatetime - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_smalldatetime = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_smalldatetime + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_smalldatetime = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; col_time @@ -536,16 +546,16 @@ select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30' (1 row) explain (costs off) select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; - QUERY PLAN ------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_time - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_time - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_time = "*VALUES*".column1) - -> CStore Scan on "time" + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_time + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_time = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -557,16 +567,16 @@ select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', (1 row) explain (costs off) select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; - QUERY PLAN --------------------------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_timetz - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_timetz - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_timetz = "*VALUES*".column1) - -> CStore Scan on "time" + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_timetz + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_timetz = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Sonic Hash Aggregate + Group By Key: "*VALUES*".column1 -> Vector Adapter -> Values Scan on "*VALUES*" (10 rows) @@ -579,19 +589,20 @@ select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18 (2 rows) explain (costs off) select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; - QUERY PLAN ----------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_interval - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_interval - -> Vector Hash Semi Join - Hash Cond: (inlist2join_type_c."time".col_interval = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Adapter - -> Values Scan on "*VALUES*" -(10 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_interval + -> Vector Sonic Hash Join + Hash Cond: (inlist2join_type_c."time".col_interval = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Unique + -> Vector Sort + Sort Key: "*VALUES*".column1 + -> Vector Adapter + -> Values Scan on "*VALUES*" +(11 rows) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; col_tinterval @@ -601,20 +612,18 @@ select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" (2 rows) explain (costs off) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; - QUERY PLAN -------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: inlist2join_type_c."time".col_tinterval - -> Vector Sort - Sort Key: inlist2join_type_c."time".col_tinterval - -> Vector Nest Loop Semi Join - Join Filter: (inlist2join_type_c."time".col_tinterval = "*VALUES*".column1) - -> CStore Scan on "time" - -> Vector Materialize - -> Vector Adapter - -> Values Scan on "*VALUES*" -(11 rows) + -> Vector Sort + Sort Key: inlist2join_type_c."time".col_tinterval + -> Vector Nest Loop Semi Join + Join Filter: (inlist2join_type_c."time".col_tinterval = "*VALUES*".column1) + -> CStore Scan on "time" + -> Vector Materialize + -> Vector Adapter + -> Values Scan on "*VALUES*" +(9 rows) drop schema inlist2join_type_c cascade; NOTICE: drop cascades to 2 other objects diff --git a/src/test/regress/expected/magic_set.out b/src/test/regress/expected/magic_set.out index e1d35880e..2857d94cd 100644 --- a/src/test/regress/expected/magic_set.out +++ b/src/test/regress/expected/magic_set.out @@ -1,11 +1,20 @@ create schema magic_set; set search_path=magic_set; -create table magic_t1(a int, b varchar, c int, d int) distribute by hash(a); -create table magic_t2(a int, b varchar, c int, d int) distribute by hash(a); -create table magic_t3(a int, b varchar, c int, d int) distribute by hash(a); +create table magic_t1(a int, b varchar, c int, d int); +create table magic_t2(a int, b varchar, c int, d int); +create table magic_t3(a int, b varchar, c int, d int); insert into magic_t1 select generate_series(1, 1000), generate_series(1, 1000), generate_series(1, 1000), generate_series(1, 1000) from public.src; +ERROR: relation "public.src" does not exist on datanode1 +LINE 1: ...te_series(1, 1000), generate_series(1, 1000) from public.src... + ^ insert into magic_t2 select generate_series(1, 100), generate_series(1, 200), generate_series(1, 300), generate_series(1, 500) from public.src; +ERROR: relation "public.src" does not exist on datanode1 +LINE 1: ...rate_series(1, 300), generate_series(1, 500) from public.src... + ^ insert into magic_t3 select generate_series(1, 100), generate_series(1, 200), generate_series(1, 300), generate_series(1, 500) from public.src; +ERROR: relation "public.src" does not exist on datanode1 +LINE 1: ...rate_series(1, 300), generate_series(1, 500) from public.src... + ^ analyze magic_t1; analyze magic_t2; analyze magic_t3; @@ -20,130 +29,72 @@ explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b = 10 and t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((t1.c < (sum(t2.c))) AND (t1.a = t2.a)) + QUERY PLAN +------------------------------------------------------------------------ + Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash -> Hash Join Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint = 10) - -> Materialize + Join Filter: (t1.c < (sum(t2.c))) -> HashAggregate Group By Key: t2.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t2.a = t1.a) -> Seq Scan on magic_t2 t2 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint = 10) -(19 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint = 10) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint = 10) +(20 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b = 10 and t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d -----+-----+-----+----- - 10 | 10 | 10 | 10 - 10 | 10 | 10 | 110 - 10 | 10 | 10 | 210 - 10 | 10 | 10 | 310 - 10 | 10 | 10 | 410 - 10 | 10 | 110 | 10 - 10 | 10 | 110 | 110 - 10 | 10 | 110 | 210 - 10 | 10 | 110 | 310 - 10 | 10 | 110 | 410 - 10 | 10 | 210 | 10 - 10 | 10 | 210 | 110 - 10 | 10 | 210 | 210 - 10 | 10 | 210 | 310 - 10 | 10 | 210 | 410 - 10 | 110 | 10 | 10 - 10 | 110 | 10 | 110 - 10 | 110 | 10 | 210 - 10 | 110 | 10 | 310 - 10 | 110 | 10 | 410 - 10 | 110 | 110 | 10 - 10 | 110 | 110 | 110 - 10 | 110 | 110 | 210 - 10 | 110 | 110 | 310 - 10 | 110 | 110 | 410 - 10 | 110 | 210 | 10 - 10 | 110 | 210 | 110 - 10 | 110 | 210 | 210 - 10 | 110 | 210 | 310 - 10 | 110 | 210 | 410 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b < 2 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ------------------------------------------------------------------------------ - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c < (max(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint < 2) - -> Hash + QUERY PLAN +----------------------------------------------------------------------------------- + Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.max) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint < 2) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t2.a = t1.a) -> Seq Scan on magic_t2 t2 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint < 2) -(20 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint < 2) +(21 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b < 2 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 1 | 201 | 1 - 1 | 1 | 201 | 101 - 1 | 1 | 201 | 201 - 1 | 1 | 201 | 301 - 1 | 1 | 201 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 1 | 101 | 201 | 1 - 1 | 101 | 201 | 101 - 1 | 101 | 201 | 201 - 1 | 101 | 201 | 301 - 1 | 101 | 201 | 401 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and @@ -151,688 +102,342 @@ t1.b > 50 and t1.b < 55 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a); QUERY PLAN ------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Nested Loop - Join Filter: ((t1.c < (max(t2.c))) AND (t1.a = t2.a)) - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) - -> HashAggregate - Group By Key: t2.a - -> Hash Semi Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash + Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t2.a = t1.a) + Join Filter: (t1.c < (max(t2.c))) + -> HashAggregate + Group By Key: t2.a + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> HashAggregate + Group By Key: t1.a -> Seq Scan on magic_t1 t1 Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) -(18 rows) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) +(20 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 50 and t1.b < 55 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d -----+-----+-----+----- - 51 | 151 | 51 | 51 - 51 | 151 | 51 | 151 - 51 | 151 | 51 | 251 - 51 | 151 | 51 | 351 - 51 | 151 | 51 | 451 - 51 | 151 | 151 | 51 - 51 | 151 | 151 | 151 - 51 | 151 | 151 | 251 - 51 | 151 | 151 | 351 - 51 | 151 | 151 | 451 - 51 | 151 | 251 | 51 - 51 | 151 | 251 | 151 - 51 | 151 | 251 | 251 - 51 | 151 | 251 | 351 - 51 | 151 | 251 | 451 - 51 | 51 | 51 | 51 - 51 | 51 | 51 | 151 - 51 | 51 | 51 | 251 - 51 | 51 | 51 | 351 - 51 | 51 | 51 | 451 - 51 | 51 | 151 | 51 - 51 | 51 | 151 | 151 - 51 | 51 | 151 | 251 - 51 | 51 | 151 | 351 - 51 | 51 | 151 | 451 - 51 | 51 | 251 | 51 - 51 | 51 | 251 | 151 - 51 | 51 | 251 | 251 - 51 | 51 | 251 | 351 - 51 | 51 | 251 | 451 - 52 | 152 | 52 | 52 - 52 | 152 | 52 | 152 - 52 | 152 | 52 | 252 - 52 | 152 | 52 | 352 - 52 | 152 | 52 | 452 - 52 | 152 | 152 | 52 - 52 | 152 | 152 | 152 - 52 | 152 | 152 | 252 - 52 | 152 | 152 | 352 - 52 | 152 | 152 | 452 - 52 | 152 | 252 | 52 - 52 | 152 | 252 | 152 - 52 | 152 | 252 | 252 - 52 | 152 | 252 | 352 - 52 | 152 | 252 | 452 - 52 | 52 | 52 | 52 - 52 | 52 | 52 | 152 - 52 | 52 | 52 | 252 - 52 | 52 | 52 | 352 - 52 | 52 | 52 | 452 - 52 | 52 | 152 | 52 - 52 | 52 | 152 | 152 - 52 | 52 | 152 | 252 - 52 | 52 | 152 | 352 - 52 | 52 | 152 | 452 - 52 | 52 | 252 | 52 - 52 | 52 | 252 | 152 - 52 | 52 | 252 | 252 - 52 | 52 | 252 | 352 - 52 | 52 | 252 | 452 - 53 | 153 | 53 | 53 - 53 | 153 | 53 | 153 - 53 | 153 | 53 | 253 - 53 | 153 | 53 | 353 - 53 | 153 | 53 | 453 - 53 | 153 | 153 | 53 - 53 | 153 | 153 | 153 - 53 | 153 | 153 | 253 - 53 | 153 | 153 | 353 - 53 | 153 | 153 | 453 - 53 | 153 | 253 | 53 - 53 | 153 | 253 | 153 - 53 | 153 | 253 | 253 - 53 | 153 | 253 | 353 - 53 | 153 | 253 | 453 - 53 | 53 | 53 | 53 - 53 | 53 | 53 | 153 - 53 | 53 | 53 | 253 - 53 | 53 | 53 | 353 - 53 | 53 | 53 | 453 - 53 | 53 | 153 | 53 - 53 | 53 | 153 | 153 - 53 | 53 | 153 | 253 - 53 | 53 | 153 | 353 - 53 | 53 | 153 | 453 - 53 | 53 | 253 | 53 - 53 | 53 | 253 | 153 - 53 | 53 | 253 | 253 - 53 | 53 | 253 | 353 - 53 | 53 | 253 | 453 - 54 | 154 | 54 | 54 - 54 | 154 | 54 | 154 - 54 | 154 | 54 | 254 - 54 | 154 | 54 | 354 - 54 | 154 | 54 | 454 - 54 | 154 | 154 | 54 - 54 | 154 | 154 | 154 - 54 | 154 | 154 | 254 - 54 | 154 | 154 | 354 - 54 | 154 | 154 | 454 - 54 | 154 | 254 | 54 - 54 | 154 | 254 | 154 - 54 | 154 | 254 | 254 - 54 | 154 | 254 | 354 - 54 | 154 | 254 | 454 - 54 | 54 | 54 | 54 - 54 | 54 | 54 | 154 - 54 | 54 | 54 | 254 - 54 | 54 | 54 | 354 - 54 | 54 | 54 | 454 - 54 | 54 | 154 | 54 - 54 | 54 | 154 | 154 - 54 | 54 | 154 | 254 - 54 | 54 | 154 | 354 - 54 | 54 | 154 | 454 - 54 | 54 | 254 | 54 - 54 | 54 | 254 | 154 - 54 | 54 | 254 | 254 - 54 | 54 | 254 | 354 - 54 | 54 | 254 | 454 -(120 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 50 or t1.b < 55 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ---------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------- + Nested Loop + Join Filter: (((t1.a = t2.a) AND ((t1.b)::bigint > 50)) OR (((t1.b)::bigint < 55) AND (subquery."?column?" IS NOT NULL) AND (t1.c < subquery.max))) -> Hash Left Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c < (max(t2.c))) - Filter: (((t1.a = t2.a) AND ((t1.b)::bigint > 50)) OR (((t1.b)::bigint < 55) AND (t2.a IS NOT NULL))) - -> Nested Loop - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - -> Materialize - -> Seq Scan on magic_t2 t2 + Hash Cond: (t1.a = subquery."?column?") + -> Seq Scan on magic_t1 t1 -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a -> Seq Scan on magic_t2 t2 -(18 rows) + -> Materialize + -> Seq Scan on magic_t2 t2 +(12 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 50 or t1.b < 55 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4 limit 50; a | b | c | d ---+---+---+--- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 1 -(50 rows) +(0 rows) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and (t1.b > 50 or t1.b < 55) and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c < (max(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 50) OR ((b)::bigint < 55)) - -> Hash + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.max) + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 50) OR ((b)::bigint < 55)) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t2.a = t1.a) -> Seq Scan on magic_t2 t2 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 50) OR ((b)::bigint < 55)) -(20 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 50) OR ((b)::bigint < 55)) +(21 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and (t1.b > 50 or t1.b < 55) and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4 limit 50; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 1 | 201 | 1 - 1 | 1 | 201 | 101 - 1 | 1 | 201 | 201 - 1 | 1 | 201 | 301 - 1 | 1 | 201 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 1 | 101 | 201 | 1 - 1 | 101 | 201 | 101 - 1 | 101 | 201 | 201 - 1 | 101 | 201 | 301 - 1 | 101 | 201 | 401 - 2 | 102 | 2 | 2 - 2 | 102 | 2 | 102 - 2 | 102 | 2 | 202 - 2 | 102 | 2 | 302 - 2 | 102 | 2 | 402 - 2 | 102 | 102 | 2 - 2 | 102 | 102 | 102 - 2 | 102 | 102 | 202 - 2 | 102 | 102 | 302 - 2 | 102 | 102 | 402 - 2 | 102 | 202 | 2 - 2 | 102 | 202 | 102 - 2 | 102 | 202 | 202 - 2 | 102 | 202 | 302 - 2 | 102 | 202 | 402 - 2 | 2 | 2 | 2 - 2 | 2 | 2 | 102 - 2 | 2 | 2 | 202 - 2 | 2 | 2 | 302 - 2 | 2 | 2 | 402 -(50 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 50 and t1.b < 55 and COALESCE(t1.a::varchar, t1.b) = 51 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((t1.c < (max(t2.c))) AND (t1.a = t2.a)) + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash -> Hash Join Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 50) AND ((b)::bigint < 55) AND ((COALESCE((a)::character varying, b))::bigint = 51)) - -> Materialize + Join Filter: (t1.c < (max(t2.c))) -> HashAggregate Group By Key: t2.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t2.a = t1.a) -> Seq Scan on magic_t2 t2 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 50) AND ((b)::bigint < 55) AND ((COALESCE((a)::character varying, b))::bigint = 51)) -(19 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 50) AND ((b)::bigint < 55) AND ((COALESCE((a)::character varying, b))::bigint = 51)) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 50) AND ((b)::bigint < 55) AND ((COALESCE((a)::character varying, b))::bigint = 51)) +(20 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 50 and t1.b < 55 and COALESCE(t1.a::varchar, t1.b) = 51 and t1.c < (select max(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d -----+-----+-----+----- - 51 | 151 | 51 | 51 - 51 | 151 | 51 | 151 - 51 | 151 | 51 | 251 - 51 | 151 | 51 | 351 - 51 | 151 | 51 | 451 - 51 | 151 | 151 | 51 - 51 | 151 | 151 | 151 - 51 | 151 | 151 | 251 - 51 | 151 | 151 | 351 - 51 | 151 | 151 | 451 - 51 | 151 | 251 | 51 - 51 | 151 | 251 | 151 - 51 | 151 | 251 | 251 - 51 | 151 | 251 | 351 - 51 | 151 | 251 | 451 - 51 | 51 | 51 | 51 - 51 | 51 | 51 | 151 - 51 | 51 | 51 | 251 - 51 | 51 | 51 | 351 - 51 | 51 | 51 | 451 - 51 | 51 | 151 | 51 - 51 | 51 | 151 | 151 - 51 | 51 | 151 | 251 - 51 | 51 | 151 | 351 - 51 | 51 | 151 | 451 - 51 | 51 | 251 | 51 - 51 | 51 | 251 | 151 - 51 | 51 | 251 | 251 - 51 | 51 | 251 | 351 - 51 | 51 | 251 | 451 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select COUNT(*) from magic_t1 as t1, magic_t2 as t2 where t1.b < 100 and case when t1.b is null then false else true end and t1.c <= (select avg(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate - -> Streaming (type: GATHER) - Node/s: All datanodes - -> Aggregate - -> Nested Loop - -> Seq Scan on magic_t2 t2 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: ((t1.c)::numeric <= (avg(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: (CASE WHEN (b IS NULL) THEN false ELSE true END AND ((b)::bigint < 100)) - -> Hash - -> HashAggregate - Group By Key: t2.a - -> Hash Semi Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: (CASE WHEN (b IS NULL) THEN false ELSE true END AND ((b)::bigint < 100)) -(23 rows) + -> Nested Loop + -> Seq Scan on magic_t2 t2 + -> Materialize + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: ((t1.c)::numeric <= subquery.avg) + -> Seq Scan on magic_t1 t1 + Filter: (CASE WHEN (b IS NULL) THEN false ELSE true END AND ((b)::bigint < 100)) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t2.a + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: (CASE WHEN (b IS NULL) THEN false ELSE true END AND ((b)::bigint < 100)) +(21 rows) select COUNT(*) from magic_t1 as t1, magic_t2 as t2 where t1.b < 100 and case when t1.b is null then false else true end and t1.c <= (select avg(c) from magic_t2 t2 where t1.a = t2.a); - count --------- - 297000 + count +------- + 0 (1 row) explain (costs off) select COUNT(*) from magic_t1 as t1, magic_t2 as t2 where case when t1.b is null then false else true end and t1.c <= (select avg(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - Node/s: All datanodes - -> Aggregate - -> Nested Loop - -> Seq Scan on magic_t2 t2 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: ((t1.c)::numeric <= (avg(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: CASE WHEN (b IS NULL) THEN false ELSE true END - -> Hash - -> HashAggregate - Group By Key: t2.a - -> Hash Semi Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: CASE WHEN (b IS NULL) THEN false ELSE true END -(23 rows) + -> Nested Loop + -> Seq Scan on magic_t2 t2 + -> Materialize + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: ((t1.c)::numeric <= subquery.avg) + -> Seq Scan on magic_t1 t1 + Filter: CASE WHEN (b IS NULL) THEN false ELSE true END + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t2.a + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: CASE WHEN (b IS NULL) THEN false ELSE true END +(21 rows) explain (costs off) select COUNT(*) from magic_t1 as t1, magic_t2 as t2 where t1.b < 100 and t1.c <= (select avg(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN -------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - Node/s: All datanodes - -> Aggregate - -> Nested Loop - -> Seq Scan on magic_t2 t2 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: ((t1.c)::numeric <= (avg(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint < 100) - -> Hash - -> HashAggregate - Group By Key: t2.a - -> Hash Semi Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint < 100) -(23 rows) + -> Nested Loop + -> Seq Scan on magic_t2 t2 + -> Materialize + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: ((t1.c)::numeric <= subquery.avg) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint < 100) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t2.a + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint < 100) +(21 rows) select COUNT(*) from magic_t1 as t1, magic_t2 as t2 where t1.b < 100 and t1.c <= (select avg(c) from magic_t2 t2 where t1.a = t2.a); - count --------- - 297000 + count +------- + 0 (1 row) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 10 and t1.c < 12 and t1.b = t1.c and t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - QUERY PLAN -------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: ((t1.c < (sum(t2.c))) AND (t2.a = t2.a)) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash -> Hash Join Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((c < 12) AND ((b)::bigint > 10) AND ((b)::bigint = c)) - -> Materialize + Join Filter: (t1.c < (sum(t2.c))) -> HashAggregate Group By Key: t2.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t2.a = t1.a) -> Seq Scan on magic_t2 t2 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((c < 12) AND ((b)::bigint > 10) AND ((b)::bigint = c)) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((c < 12) AND ((b)::bigint > 10) AND ((b)::bigint = c)) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: ((c < 12) AND ((b)::bigint > 10) AND ((b)::bigint = c)) (22 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b > 10 and t1.c < 12 and t1.b = t1.c and t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d -----+-----+-----+----- - 11 | 11 | 11 | 11 - 11 | 11 | 11 | 111 - 11 | 11 | 11 | 211 - 11 | 11 | 11 | 311 - 11 | 11 | 11 | 411 - 11 | 11 | 111 | 11 - 11 | 11 | 111 | 111 - 11 | 11 | 111 | 211 - 11 | 11 | 111 | 311 - 11 | 11 | 111 | 411 - 11 | 11 | 211 | 11 - 11 | 11 | 211 | 111 - 11 | 11 | 211 | 211 - 11 | 11 | 211 | 311 - 11 | 11 | 211 | 411 - 11 | 111 | 11 | 11 - 11 | 111 | 11 | 111 - 11 | 111 | 11 | 211 - 11 | 111 | 11 | 311 - 11 | 111 | 11 | 411 - 11 | 111 | 111 | 11 - 11 | 111 | 111 | 111 - 11 | 111 | 111 | 211 - 11 | 111 | 111 | 311 - 11 | 111 | 111 | 411 - 11 | 111 | 211 | 11 - 11 | 111 | 211 | 111 - 11 | 111 | 211 | 211 - 11 | 111 | 211 | 311 - 11 | 111 | 211 | 411 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where t1.b > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c <= (sum(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 99) - -> Hash + QUERY PLAN +------------------------------------------------------------------------------------ + Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 99) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t2.a = t1.a) -> Seq Scan on magic_t2 t2 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 99) -(20 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 99) +(21 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where t1.b > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a)order by 1,2,3,4; - a | b | c | d ------+-----+-----+----- - 100 | 100 | 100 | 100 - 100 | 100 | 100 | 200 - 100 | 100 | 100 | 300 - 100 | 100 | 100 | 400 - 100 | 100 | 100 | 500 - 100 | 100 | 200 | 100 - 100 | 100 | 200 | 200 - 100 | 100 | 200 | 300 - 100 | 100 | 200 | 400 - 100 | 100 | 200 | 500 - 100 | 100 | 300 | 100 - 100 | 100 | 300 | 200 - 100 | 100 | 300 | 300 - 100 | 100 | 300 | 400 - 100 | 100 | 300 | 500 - 100 | 200 | 100 | 100 - 100 | 200 | 100 | 200 - 100 | 200 | 100 | 300 - 100 | 200 | 100 | 400 - 100 | 200 | 100 | 500 - 100 | 200 | 200 | 100 - 100 | 200 | 200 | 200 - 100 | 200 | 200 | 300 - 100 | 200 | 200 | 400 - 100 | 200 | 200 | 500 - 100 | 200 | 300 | 100 - 100 | 200 | 300 | 200 - 100 | 200 | 300 | 300 - 100 | 200 | 300 | 400 - 100 | 200 | 300 | 500 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where t1.a > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN -------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c <= (sum(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: (a > 99) - -> Hash + QUERY PLAN +------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: (a > 99) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a - -> Hash Right Semi Join - Hash Cond: (t1.a = t2.a) - -> Seq Scan on magic_t1 t1 + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 Filter: (a > 99) -> Hash - -> Seq Scan on magic_t2 t2 - Filter: (a > 99) -(21 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: (a > 99) +(22 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where t1.a > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d ------+-----+-----+----- - 100 | 100 | 100 | 100 - 100 | 100 | 100 | 200 - 100 | 100 | 100 | 300 - 100 | 100 | 100 | 400 - 100 | 100 | 100 | 500 - 100 | 100 | 200 | 100 - 100 | 100 | 200 | 200 - 100 | 100 | 200 | 300 - 100 | 100 | 200 | 400 - 100 | 100 | 200 | 500 - 100 | 100 | 300 | 100 - 100 | 100 | 300 | 200 - 100 | 100 | 300 | 300 - 100 | 100 | 300 | 400 - 100 | 100 | 300 | 500 - 100 | 200 | 100 | 100 - 100 | 200 | 100 | 200 - 100 | 200 | 100 | 300 - 100 | 200 | 100 | 400 - 100 | 200 | 100 | 500 - 100 | 200 | 200 | 100 - 100 | 200 | 200 | 200 - 100 | 200 | 200 | 300 - 100 | 200 | 200 | 400 - 100 | 200 | 200 | 500 - 100 | 200 | 300 | 100 - 100 | 200 | 300 | 200 - 100 | 200 | 300 | 300 - 100 | 200 | 300 | 400 - 100 | 200 | 300 | 500 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) @@ -840,65 +445,36 @@ where t1.a > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a and t1.b = t2.b); QUERY PLAN ---------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: ((t1.a = t2.a) AND ((t1.b)::text = ((t2.b)::text))) - Join Filter: (t1.c <= (sum(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: (a > 99) - -> Hash + Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: ((t1.a = subquery."?column?") AND ((t1.b)::text = subquery."?column?")) + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: (a > 99) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a, (t2.b)::text - -> Hash Right Semi Join - Hash Cond: ((t1.a = t2.a) AND ((t1.b)::text = (t2.b)::text)) - -> Seq Scan on magic_t1 t1 + -> Hash Join + Hash Cond: ((t2.a = t1.a) AND ((t2.b)::text = (t1.b)::text)) + -> Seq Scan on magic_t2 t2 Filter: (a > 99) -> Hash - -> Seq Scan on magic_t2 t2 - Filter: (a > 99) -(21 rows) + -> HashAggregate + Group By Key: t1.a, (t1.b)::text + -> Seq Scan on magic_t1 t1 + Filter: (a > 99) +(22 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where t1.a > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a and t1.b = t2.b)order by 1,2,3,4; - a | b | c | d ------+-----+-----+----- - 100 | 100 | 100 | 100 - 100 | 100 | 100 | 200 - 100 | 100 | 100 | 300 - 100 | 100 | 100 | 400 - 100 | 100 | 100 | 500 - 100 | 100 | 200 | 100 - 100 | 100 | 200 | 200 - 100 | 100 | 200 | 300 - 100 | 100 | 200 | 400 - 100 | 100 | 200 | 500 - 100 | 100 | 300 | 100 - 100 | 100 | 300 | 200 - 100 | 100 | 300 | 300 - 100 | 100 | 300 | 400 - 100 | 100 | 300 | 500 - 100 | 200 | 100 | 100 - 100 | 200 | 100 | 200 - 100 | 200 | 100 | 300 - 100 | 200 | 100 | 400 - 100 | 200 | 100 | 500 - 100 | 200 | 200 | 100 - 100 | 200 | 200 | 200 - 100 | 200 | 200 | 300 - 100 | 200 | 200 | 400 - 100 | 200 | 200 | 500 - 100 | 200 | 300 | 100 - 100 | 200 | 300 | 200 - 100 | 200 | 300 | 300 - 100 | 200 | 300 | 400 - 100 | 200 | 300 | 500 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) @@ -906,241 +482,74 @@ where t1.a > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.b = t2.b and t1.c = t2.c); QUERY PLAN ---------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Hash Join - Hash Cond: ((((t2.b)::text) = (t1.b)::text) AND (t2.c = t1.c)) - Join Filter: (t1.c <= (sum(t2.c))) + Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (((t1.b)::text = subquery."?column?") AND (t1.c = subquery."?column?")) + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: (a > 99) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: (t2.b)::text, t2.c -> Hash Join - Hash Cond: ((t2.c = t1.c) AND ((t2.b)::text = (t1.b)::text)) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t2 t2 + Hash Cond: (((t2.b)::text = (t1.b)::text) AND (t2.c = t1.c)) + -> Seq Scan on magic_t2 t2 -> Hash -> HashAggregate Group By Key: (t1.b)::text, t1.c - -> Result - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - Filter: (a > 99) - -> Hash - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - Filter: (a > 99) -(31 rows) + -> Seq Scan on magic_t1 t1 + Filter: (a > 99) +(21 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where t1.a > 99 and t1.c <= (select sum(c) from magic_t2 t2 where t1.b = t2.b and t1.c = t2.c) order by 1,2,3,4; - a | b | c | d ------+-----+-----+----- - 100 | 100 | 100 | 100 - 100 | 100 | 100 | 200 - 100 | 100 | 100 | 300 - 100 | 100 | 100 | 400 - 100 | 100 | 100 | 500 - 100 | 100 | 200 | 100 - 100 | 100 | 200 | 200 - 100 | 100 | 200 | 300 - 100 | 100 | 200 | 400 - 100 | 100 | 200 | 500 - 100 | 100 | 300 | 100 - 100 | 100 | 300 | 200 - 100 | 100 | 300 | 300 - 100 | 100 | 300 | 400 - 100 | 100 | 300 | 500 - 100 | 200 | 100 | 100 - 100 | 200 | 100 | 200 - 100 | 200 | 100 | 300 - 100 | 200 | 100 | 400 - 100 | 200 | 100 | 500 - 100 | 200 | 200 | 100 - 100 | 200 | 200 | 200 - 100 | 200 | 200 | 300 - 100 | 200 | 200 | 400 - 100 | 200 | 200 | 500 - 100 | 200 | 300 | 100 - 100 | 200 | 300 | 200 - 100 | 200 | 300 | 300 - 100 | 200 | 300 | 400 - 100 | 200 | 300 | 500 - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | -(130 rows) + a | b | c | d +---+---+---+--- +(0 rows) --include or clause explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where (t1.a > 999 or t1.a < 2) and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a); - QUERY PLAN ----------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((t1.c <= (sum(t2.c))) AND (t1.a = t2.a)) - -> HashAggregate - Group By Key: t2.a - -> Nested Loop Semi Join - Join Filter: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - Filter: ((a > 999) OR (a < 2)) - -> Materialize - -> Seq Scan on magic_t1 t1 - Filter: ((a > 999) OR (a < 2)) - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 + QUERY PLAN +---------------------------------------------------------------------------------------- + Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((a > 999) OR (a < 2)) -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((a > 999) OR (a < 2)) -(19 rows) + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t2.a + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + Filter: ((a > 999) OR (a < 2)) + -> Hash + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((a > 999) OR (a < 2)) +(22 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where (t1.a > 999 or t1.a < 2) and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a)order by 1,2,3,4; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 1 | 201 | 1 - 1 | 1 | 201 | 101 - 1 | 1 | 201 | 201 - 1 | 1 | 201 | 301 - 1 | 1 | 201 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 1 | 101 | 201 | 1 - 1 | 101 | 201 | 101 - 1 | 101 | 201 | 201 - 1 | 101 | 201 | 301 - 1 | 101 | 201 | 401 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) @@ -1149,145 +558,79 @@ t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a and t1.b = t2.b) order by 1,2,3,4; QUERY PLAN ---------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: ((t1.c <= (sum(t2.c))) AND (t1.a = t2.a) AND ((t1.b)::text = ((t2.b)::text))) - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: ((t1.a = subquery."?column?") AND ((t1.b)::text = subquery."?column?")) + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((a > 999) OR (a < 2)) -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((a > 999) OR (a < 2)) - -> Materialize - -> HashAggregate - Group By Key: t2.a, (t2.b)::text - -> Nested Loop Semi Join - Join Filter: ((t2.a = t1.a) AND ((t2.b)::text = (t1.b)::text)) - -> Seq Scan on magic_t2 t2 - Filter: ((a > 999) OR (a < 2)) - -> Materialize - -> Seq Scan on magic_t1 t1 - Filter: ((a > 999) OR (a < 2)) -(23 rows) + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t2.a, (t2.b)::text + -> Hash Join + Hash Cond: ((t2.a = t1.a) AND ((t2.b)::text = (t1.b)::text)) + -> Seq Scan on magic_t2 t2 + Filter: ((a > 999) OR (a < 2)) + -> Hash + -> HashAggregate + Group By Key: t1.a, (t1.b)::text + -> Seq Scan on magic_t1 t1 + Filter: ((a > 999) OR (a < 2)) +(24 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where (t1.a > 999 or t1.a < 2) and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a and t1.b = t2.b) order by 1,2,3,4; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 1 | 201 | 1 - 1 | 1 | 201 | 101 - 1 | 1 | 201 | 201 - 1 | 1 | 201 | 301 - 1 | 1 | 201 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 1 | 101 | 201 | 1 - 1 | 101 | 201 | 101 - 1 | 101 | 201 | 201 - 1 | 101 | 201 | 301 - 1 | 101 | 201 | 401 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where (t1.a > 999 or t1.a < 2) and t1.c <= (select sum(c) from magic_t2 t2 where t1.c = t2.c and t1.b = t2.b and t1.d = t2.d) order by 1,2,3,4; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Nested Loop - Join Filter: ((t1.c <= (sum(t2.c))) AND (t1.c = t2.c) AND ((t1.b)::text = ((t2.b)::text)) AND (t1.d = t2.d)) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - Filter: ((a > 999) OR (a < 2)) - -> Materialize - -> HashAggregate - Group By Key: t2.c, ((t2.b)::text), t2.d - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Hash Semi Join - Hash Cond: ((t2.c = t1.c) AND (t2.d = t1.d) AND ((t2.b)::text = (t1.b)::text)) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - Filter: ((a > 999) OR (a < 2)) -(30 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Right Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: ((t1.c = subquery."?column?") AND ((t1.b)::text = subquery."?column?") AND (t1.d = subquery."?column?")) + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((a > 999) OR (a < 2)) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t2.c, (t2.b)::text, t2.d + -> Hash Join + Hash Cond: ((t2.c = t1.c) AND ((t2.b)::text = (t1.b)::text) AND (t2.d = t1.d)) + -> Seq Scan on magic_t2 t2 + -> Hash + -> HashAggregate + Group By Key: t1.c, (t1.b)::text, t1.d + -> Seq Scan on magic_t1 t1 + Filter: ((a > 999) OR (a < 2)) +(23 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where (t1.a > 999 or t1.a < 2) and t1.c <= (select sum(c) from magic_t2 t2 where t1.c = t2.c and t1.b = t2.b and t1.d = t2.d) order by 1,2,3,4; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 1 | 201 | 1 - 1 | 1 | 201 | 101 - 1 | 1 | 201 | 201 - 1 | 1 | 201 | 301 - 1 | 1 | 201 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 1 | 101 | 201 | 1 - 1 | 101 | 201 | 101 - 1 | 101 | 201 | 201 - 1 | 101 | 201 | 301 - 1 | 101 | 201 | 401 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) @@ -1296,63 +639,31 @@ t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - Filter: ((t1.a > (t2.b)::bigint) OR (t1.a < 2)) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c <= (sum(t2.c))) - -> Seq Scan on magic_t1 t1 - -> Hash + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Right Join + Hash Cond: (t2.a = t1.a) + Filter: ((t1.a > (t2.b)::bigint) OR (t1.a < 2)) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a -> Seq Scan on magic_t2 t2 -(18 rows) +(16 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) where (t1.a > t2.b or t1.a < 2) and t1.c <= (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 1 | 201 | 1 - 1 | 1 | 201 | 101 - 1 | 1 | 201 | 201 - 1 | 1 | 201 | 301 - 1 | 1 | 201 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 1 | 101 | 201 | 1 - 1 | 101 | 201 | 101 - 1 | 101 | 201 | 201 - 1 | 101 | 201 | 301 - 1 | 101 | 201 | 401 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) --sublink in join qual explain (costs off) @@ -1363,28 +674,29 @@ where t2.b > 50 and t2.b < 55 and t2.c is null order by 1,2,3,4; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: ((t2.c < (max(t3.c))) AND (t1.a = t2.a)) - -> Seq Scan on magic_t2 t2 - Filter: ((c IS NULL) AND ((b)::bigint > 50) AND ((b)::bigint < 55)) + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t1.a = t2.a) + -> Seq Scan on magic_t1 t1 + -> Hash -> Hash Join - Hash Cond: (t1.a = t3.a) - -> Seq Scan on magic_t1 t1 - -> Hash - -> HashAggregate - Group By Key: t3.a - -> Hash Semi Join - Hash Cond: (t3.a = t2.a) - -> Seq Scan on magic_t3 t3 - -> Hash + Hash Cond: (t3.a = t2.a) + Join Filter: (t2.c < (max(t3.c))) + -> HashAggregate + Group By Key: t3.a + -> Hash Join + Hash Cond: (t3.a = t2.a) + -> Seq Scan on magic_t3 t3 + -> Hash + -> HashAggregate + Group By Key: t2.a -> Seq Scan on magic_t2 t2 Filter: ((c IS NULL) AND ((b)::bigint > 50) AND ((b)::bigint < 55)) -(21 rows) + -> Hash + -> Seq Scan on magic_t2 t2 + Filter: ((c IS NULL) AND ((b)::bigint > 50) AND ((b)::bigint < 55)) +(22 rows) select t2.* from magic_t1 as t1 inner join magic_t2 as t2 on t1.a = t2.a and @@ -1401,97 +713,39 @@ t1.a = t2.a and t2.c < (select max(c) from magic_t3 t3 where t2.a = t3.a) where t2.b in (select c from magic_t3) order by 1,2,3,4; - QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (((t2.b)::bigint) = magic_t3.c) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes + QUERY PLAN +------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t1.a = t2.a) + -> Seq Scan on magic_t1 t1 + -> Hash + -> Hash Join + Hash Cond: ((t2.b)::bigint = magic_t3.c) -> Hash Join - Hash Cond: (t2.a = t1.a) - Join Filter: (t2.c < (max(t3.c))) + Hash Cond: (t2.a = subquery."?column?") + Join Filter: (t2.c < subquery.max) -> Seq Scan on magic_t2 t2 -> Hash - -> Hash Join - Hash Cond: (t1.a = t3.a) - -> Seq Scan on magic_t1 t1 - -> Hash - -> HashAggregate - Group By Key: t3.a - -> Seq Scan on magic_t3 t3 - -> Hash - -> HashAggregate - Group By Key: magic_t3.c - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> HashAggregate - Group By Key: magic_t3.c - -> Seq Scan on magic_t3 -(29 rows) + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t3.a + -> Seq Scan on magic_t3 t3 + -> Hash + -> HashAggregate + Group By Key: magic_t3.c + -> Seq Scan on magic_t3 +(21 rows) select t2.* from magic_t1 as t1 inner join magic_t2 as t2 on t1.a = t2.a and t2.c < (select max(c) from magic_t3 t3 where t2.a = t3.a) where t2.b in (select c from magic_t3) order by 1,2,3,4 limit 50; - a | b | c | d ----+-----+-----+----- - 1 | 1 | 1 | 1 - 1 | 1 | 1 | 101 - 1 | 1 | 1 | 201 - 1 | 1 | 1 | 301 - 1 | 1 | 1 | 401 - 1 | 1 | 101 | 1 - 1 | 1 | 101 | 101 - 1 | 1 | 101 | 201 - 1 | 1 | 101 | 301 - 1 | 1 | 101 | 401 - 1 | 101 | 1 | 1 - 1 | 101 | 1 | 101 - 1 | 101 | 1 | 201 - 1 | 101 | 1 | 301 - 1 | 101 | 1 | 401 - 1 | 101 | 101 | 1 - 1 | 101 | 101 | 101 - 1 | 101 | 101 | 201 - 1 | 101 | 101 | 301 - 1 | 101 | 101 | 401 - 2 | 102 | 2 | 2 - 2 | 102 | 2 | 102 - 2 | 102 | 2 | 202 - 2 | 102 | 2 | 302 - 2 | 102 | 2 | 402 - 2 | 102 | 102 | 2 - 2 | 102 | 102 | 102 - 2 | 102 | 102 | 202 - 2 | 102 | 102 | 302 - 2 | 102 | 102 | 402 - 2 | 2 | 2 | 2 - 2 | 2 | 2 | 102 - 2 | 2 | 2 | 202 - 2 | 2 | 2 | 302 - 2 | 2 | 2 | 402 - 2 | 2 | 102 | 2 - 2 | 2 | 102 | 102 - 2 | 2 | 102 | 202 - 2 | 2 | 102 | 302 - 2 | 2 | 102 | 402 - 3 | 103 | 3 | 3 - 3 | 103 | 3 | 103 - 3 | 103 | 3 | 203 - 3 | 103 | 3 | 303 - 3 | 103 | 3 | 403 - 3 | 103 | 103 | 3 - 3 | 103 | 103 | 103 - 3 | 103 | 103 | 203 - 3 | 103 | 103 | 303 - 3 | 103 | 103 | 403 -(50 rows) + a | b | c | d +---+---+---+--- +(0 rows) --out join unsupport explain (costs off) @@ -1502,72 +756,31 @@ where t2.b > 50 and t2.b < 55 order by 1,2,3,4; QUERY PLAN ------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: ((t2.c < (max(t3.c))) AND (t2.a = t3.a)) + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t1.a = t2.a) + -> Seq Scan on magic_t1 t1 + -> Hash -> Hash Join - Hash Cond: (t1.a = t2.a) - -> Seq Scan on magic_t1 t1 + Hash Cond: (t3.a = t2.a) + Join Filter: (t2.c < (max(t3.c))) + -> HashAggregate + Group By Key: t3.a + -> Seq Scan on magic_t3 t3 -> Hash -> Seq Scan on magic_t2 t2 Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) - -> HashAggregate - Group By Key: t3.a - -> Seq Scan on magic_t3 t3 -(16 rows) +(15 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on t1.a = t2.a and t2.c < (select max(c) from magic_t3 t3 where t2.a = t3.a) where t2.b > 50 and t2.b < 55 order by 1,2,3,4; - a | b | c | d -----+----+-----+----- - 51 | 51 | 51 | 51 - 51 | 51 | 51 | 151 - 51 | 51 | 51 | 251 - 51 | 51 | 51 | 351 - 51 | 51 | 51 | 451 - 51 | 51 | 151 | 51 - 51 | 51 | 151 | 151 - 51 | 51 | 151 | 251 - 51 | 51 | 151 | 351 - 51 | 51 | 151 | 451 - 52 | 52 | 52 | 52 - 52 | 52 | 52 | 152 - 52 | 52 | 52 | 252 - 52 | 52 | 52 | 352 - 52 | 52 | 52 | 452 - 52 | 52 | 152 | 52 - 52 | 52 | 152 | 152 - 52 | 52 | 152 | 252 - 52 | 52 | 152 | 352 - 52 | 52 | 152 | 452 - 53 | 53 | 53 | 53 - 53 | 53 | 53 | 153 - 53 | 53 | 53 | 253 - 53 | 53 | 53 | 353 - 53 | 53 | 53 | 453 - 53 | 53 | 153 | 53 - 53 | 53 | 153 | 153 - 53 | 53 | 153 | 253 - 53 | 53 | 153 | 353 - 53 | 53 | 153 | 453 - 54 | 54 | 54 | 54 - 54 | 54 | 54 | 154 - 54 | 54 | 54 | 254 - 54 | 54 | 54 | 354 - 54 | 54 | 54 | 454 - 54 | 54 | 154 | 54 - 54 | 54 | 154 | 154 - 54 | 54 | 154 | 254 - 54 | 54 | 154 | 354 - 54 | 54 | 154 | 454 -(40 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1 right join magic_t2 as t2 on @@ -1576,151 +789,30 @@ t1.c < (select max(c) from magic_t3 t3 where t1.a = t3.a) where t1.b > 50 and t1.b < 55 order by 1,2,3,4; QUERY PLAN ------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Nested Loop - Join Filter: ((t1.c < (max(t3.c))) AND (t1.a = t3.a)) + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t3.a = t1.a) + Join Filter: (t1.c < (max(t3.c))) + -> HashAggregate + Group By Key: t3.a + -> Seq Scan on magic_t3 t3 + -> Hash -> Seq Scan on magic_t1 t1 Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) - -> HashAggregate - Group By Key: t3.a - -> Seq Scan on magic_t3 t3 -(16 rows) +(15 rows) select t2.* from magic_t1 as t1 right join magic_t2 as t2 on t1.a = t2.a and t1.c < (select max(c) from magic_t3 t3 where t1.a = t3.a) where t1.b > 50 and t1.b < 55 order by 1,2,3,4; - a | b | c | d -----+-----+-----+----- - 51 | 151 | 51 | 51 - 51 | 151 | 51 | 151 - 51 | 151 | 51 | 251 - 51 | 151 | 51 | 351 - 51 | 151 | 51 | 451 - 51 | 151 | 151 | 51 - 51 | 151 | 151 | 151 - 51 | 151 | 151 | 251 - 51 | 151 | 151 | 351 - 51 | 151 | 151 | 451 - 51 | 151 | 251 | 51 - 51 | 151 | 251 | 151 - 51 | 151 | 251 | 251 - 51 | 151 | 251 | 351 - 51 | 151 | 251 | 451 - 51 | 51 | 51 | 51 - 51 | 51 | 51 | 151 - 51 | 51 | 51 | 251 - 51 | 51 | 51 | 351 - 51 | 51 | 51 | 451 - 51 | 51 | 151 | 51 - 51 | 51 | 151 | 151 - 51 | 51 | 151 | 251 - 51 | 51 | 151 | 351 - 51 | 51 | 151 | 451 - 51 | 51 | 251 | 51 - 51 | 51 | 251 | 151 - 51 | 51 | 251 | 251 - 51 | 51 | 251 | 351 - 51 | 51 | 251 | 451 - 52 | 152 | 52 | 52 - 52 | 152 | 52 | 152 - 52 | 152 | 52 | 252 - 52 | 152 | 52 | 352 - 52 | 152 | 52 | 452 - 52 | 152 | 152 | 52 - 52 | 152 | 152 | 152 - 52 | 152 | 152 | 252 - 52 | 152 | 152 | 352 - 52 | 152 | 152 | 452 - 52 | 152 | 252 | 52 - 52 | 152 | 252 | 152 - 52 | 152 | 252 | 252 - 52 | 152 | 252 | 352 - 52 | 152 | 252 | 452 - 52 | 52 | 52 | 52 - 52 | 52 | 52 | 152 - 52 | 52 | 52 | 252 - 52 | 52 | 52 | 352 - 52 | 52 | 52 | 452 - 52 | 52 | 152 | 52 - 52 | 52 | 152 | 152 - 52 | 52 | 152 | 252 - 52 | 52 | 152 | 352 - 52 | 52 | 152 | 452 - 52 | 52 | 252 | 52 - 52 | 52 | 252 | 152 - 52 | 52 | 252 | 252 - 52 | 52 | 252 | 352 - 52 | 52 | 252 | 452 - 53 | 153 | 53 | 53 - 53 | 153 | 53 | 153 - 53 | 153 | 53 | 253 - 53 | 153 | 53 | 353 - 53 | 153 | 53 | 453 - 53 | 153 | 153 | 53 - 53 | 153 | 153 | 153 - 53 | 153 | 153 | 253 - 53 | 153 | 153 | 353 - 53 | 153 | 153 | 453 - 53 | 153 | 253 | 53 - 53 | 153 | 253 | 153 - 53 | 153 | 253 | 253 - 53 | 153 | 253 | 353 - 53 | 153 | 253 | 453 - 53 | 53 | 53 | 53 - 53 | 53 | 53 | 153 - 53 | 53 | 53 | 253 - 53 | 53 | 53 | 353 - 53 | 53 | 53 | 453 - 53 | 53 | 153 | 53 - 53 | 53 | 153 | 153 - 53 | 53 | 153 | 253 - 53 | 53 | 153 | 353 - 53 | 53 | 153 | 453 - 53 | 53 | 253 | 53 - 53 | 53 | 253 | 153 - 53 | 53 | 253 | 253 - 53 | 53 | 253 | 353 - 53 | 53 | 253 | 453 - 54 | 154 | 54 | 54 - 54 | 154 | 54 | 154 - 54 | 154 | 54 | 254 - 54 | 154 | 54 | 354 - 54 | 154 | 54 | 454 - 54 | 154 | 154 | 54 - 54 | 154 | 154 | 154 - 54 | 154 | 154 | 254 - 54 | 154 | 154 | 354 - 54 | 154 | 154 | 454 - 54 | 154 | 254 | 54 - 54 | 154 | 254 | 154 - 54 | 154 | 254 | 254 - 54 | 154 | 254 | 354 - 54 | 154 | 254 | 454 - 54 | 54 | 54 | 54 - 54 | 54 | 54 | 154 - 54 | 54 | 54 | 254 - 54 | 54 | 54 | 354 - 54 | 54 | 54 | 454 - 54 | 54 | 154 | 54 - 54 | 54 | 154 | 154 - 54 | 54 | 154 | 254 - 54 | 54 | 154 | 354 - 54 | 54 | 154 | 454 - 54 | 54 | 254 | 54 - 54 | 54 | 254 | 154 - 54 | 54 | 254 | 254 - 54 | 54 | 254 | 354 - 54 | 54 | 254 | 454 -(120 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select * from magic_t1 as t1 @@ -1728,37 +820,31 @@ where t1.c < (select sum(t2.a) from magic_t2 as t2 inner join magic_t3 as t3 on (t1.a = t3.a)) and t1.b > 100 order by 1,2,3,4; - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t1.a, t1.b, t1.c, t1.d - Node/s: All datanodes - -> Sort - Sort Key: t1.a, t1.b, t1.c, t1.d - -> Hash Join - Hash Cond: (t1.a = t3.a) - Join Filter: (t1.c < (sum(t2.a))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Hash + QUERY PLAN +------------------------------------------------------------------------------- + Sort + Sort Key: t1.a, t1.b, t1.c, t1.d + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t3.a -> Hash Join Hash Cond: (t1.a = t3.a) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Nested Loop - -> HashAggregate - Group By Key: t1.a - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize - -> Seq Scan on magic_t2 t2 + -> Nested Loop + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Materialize + -> Seq Scan on magic_t2 t2 -> Hash -> Seq Scan on magic_t3 t3 -(28 rows) +(22 rows) select * from magic_t1 as t1 where t1.c < (select sum(t2.a) from magic_t2 as t2 inner join magic_t3 as t3 on (1 = 1) where @@ -1773,37 +859,31 @@ explain (costs off) select * from magic_t1 as t1 where t1.c < (select sum(t2.a) from magic_t2 as t2, magic_t3 as t4 where t1.a = t4.a) and t1.b > 100 order by 1,2,3,4; - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t1.a, t1.b, t1.c, t1.d - Node/s: All datanodes - -> Sort - Sort Key: t1.a, t1.b, t1.c, t1.d - -> Hash Join - Hash Cond: (t1.a = t4.a) - Join Filter: (t1.c < (sum(t2.a))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Hash + QUERY PLAN +------------------------------------------------------------------------------- + Sort + Sort Key: t1.a, t1.b, t1.c, t1.d + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t4.a -> Hash Join Hash Cond: (t1.a = t4.a) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Nested Loop - -> HashAggregate - Group By Key: t1.a - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize - -> Seq Scan on magic_t2 t2 + -> Nested Loop + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Materialize + -> Seq Scan on magic_t2 t2 -> Hash -> Seq Scan on magic_t3 t4 -(28 rows) +(22 rows) select * from magic_t1 as t1 where t1.c < (select sum(t2.a) from magic_t2 as t2, magic_t3 as t4 where t1.a = t4.a) and @@ -1816,31 +896,31 @@ explain(costs off) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) and t1.c < (select sum(a) from magic_t3 as t3 where t1.a = t3.a) where t1.b > 100 order by 1,2,3,4; - QUERY PLAN -------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t3.a) - Join Filter: (t1.c < (sum(t3.a))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Hash + QUERY PLAN +------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t3.a - -> Hash Semi Join + -> Hash Join Hash Cond: (t3.a = t1.a) -> Seq Scan on magic_t3 t3 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) (23 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) @@ -1854,141 +934,81 @@ explain(costs off) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) and t1.c <= (select sum(a) from (select a from magic_t3 group by a) as t3 where t1.a = t3.a) where t1.b >= 100 order by 1,2,3,4; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = magic_t3.a) - Join Filter: (t1.c <= (sum(magic_t3.a))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint >= 100) - -> Hash + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint >= 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: magic_t3.a - -> Hash Right Semi Join - Hash Cond: (t1.a = magic_t3.a) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint >= 100) + -> Hash Join + Hash Cond: (magic_t3.a = t1.a) + -> HashAggregate + Group By Key: magic_t3.a + -> Seq Scan on magic_t3 -> Hash -> HashAggregate - Group By Key: magic_t3.a - -> Seq Scan on magic_t3 + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint >= 100) (25 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) and t1.c <= (select sum(a) from (select a from magic_t3 group by a) as t3 where t1.a = t3.a) where t1.b >= 100 order by 1,2,3,4; - a | b | c | d ------+-----+-----+----- - 100 | 100 | 100 | 100 - 100 | 100 | 100 | 200 - 100 | 100 | 100 | 300 - 100 | 100 | 100 | 400 - 100 | 100 | 100 | 500 - 100 | 100 | 200 | 100 - 100 | 100 | 200 | 200 - 100 | 100 | 200 | 300 - 100 | 100 | 200 | 400 - 100 | 100 | 200 | 500 - 100 | 100 | 300 | 100 - 100 | 100 | 300 | 200 - 100 | 100 | 300 | 300 - 100 | 100 | 300 | 400 - 100 | 100 | 300 | 500 - 100 | 200 | 100 | 100 - 100 | 200 | 100 | 200 - 100 | 200 | 100 | 300 - 100 | 200 | 100 | 400 - 100 | 200 | 100 | 500 - 100 | 200 | 200 | 100 - 100 | 200 | 200 | 200 - 100 | 200 | 200 | 300 - 100 | 200 | 200 | 400 - 100 | 200 | 200 | 500 - 100 | 200 | 300 | 100 - 100 | 200 | 300 | 200 - 100 | 200 | 300 | 300 - 100 | 200 | 300 | 400 - 100 | 200 | 300 | 500 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain(costs off) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c <= (select sum(a) from (select a from magic_t3 group by a) as t3 where t1.a = t3.a) and t1.b >= 100 order by 1,2,3,4; - QUERY PLAN ----------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = magic_t3.a) - Join Filter: (t1.c <= (sum(magic_t3.a))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint >= 100) - -> Hash + QUERY PLAN +-------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c <= subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint >= 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: magic_t3.a - -> Hash Right Semi Join - Hash Cond: (t1.a = magic_t3.a) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint >= 100) + -> Hash Join + Hash Cond: (magic_t3.a = t1.a) + -> HashAggregate + Group By Key: magic_t3.a + -> Seq Scan on magic_t3 -> Hash -> HashAggregate - Group By Key: magic_t3.a - -> Seq Scan on magic_t3 + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint >= 100) (25 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c <= (select sum(a) from (select a from magic_t3 group by a) as t3 where t1.a = t3.a) and t1.b >= 100 order by 1,2,3,4; - a | b | c | d ------+-----+-----+----- - 100 | 100 | 100 | 100 - 100 | 100 | 100 | 200 - 100 | 100 | 100 | 300 - 100 | 100 | 100 | 400 - 100 | 100 | 100 | 500 - 100 | 100 | 200 | 100 - 100 | 100 | 200 | 200 - 100 | 100 | 200 | 300 - 100 | 100 | 200 | 400 - 100 | 100 | 200 | 500 - 100 | 100 | 300 | 100 - 100 | 100 | 300 | 200 - 100 | 100 | 300 | 300 - 100 | 100 | 300 | 400 - 100 | 100 | 300 | 500 - 100 | 200 | 100 | 100 - 100 | 200 | 100 | 200 - 100 | 200 | 100 | 300 - 100 | 200 | 100 | 400 - 100 | 200 | 100 | 500 - 100 | 200 | 200 | 100 - 100 | 200 | 200 | 200 - 100 | 200 | 200 | 300 - 100 | 200 | 200 | 400 - 100 | 200 | 200 | 500 - 100 | 200 | 300 | 100 - 100 | 200 | 300 | 200 - 100 | 200 | 300 | 300 - 100 | 200 | 300 | 400 - 100 | 200 | 300 | 500 -(30 rows) + a | b | c | d +---+---+---+--- +(0 rows) --with more table correlation explain(costs off) @@ -1996,59 +1016,48 @@ select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b = 10 and t2.b = 10 and t1.c < (select sum(c) from magic_t3 t3 where t1.a = t3.a and t2.a = t3.a) order by 1,2,3,4; - QUERY PLAN ----------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: ((t1.c < (sum(t3.c))) AND (t2.a = t3.a)) - -> Nested Loop - Join Filter: (t1.a = t2.a) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint = 10) - -> Seq Scan on magic_t2 t2 - Filter: ((b)::bigint = 10) - -> HashAggregate - Group By Key: t3.a, t3.a - -> Nested Loop Semi Join - Join Filter: (t3.a = t2.a) - -> Hash Semi Join - Hash Cond: (t3.a = t1.a) - -> Seq Scan on magic_t3 t3 - Filter: (a IS NOT NULL) + QUERY PLAN +-------------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Nested Loop + Join Filter: (t1.a = t2.a) + -> Seq Scan on magic_t2 t2 + Filter: ((b)::bigint = 10) + -> Materialize + -> Hash Join + Hash Cond: (t3.a = t1.a) + Join Filter: (t1.c < (sum(t3.c))) + -> HashAggregate + Group By Key: t3.a, t3.a + -> Hash Join + Hash Cond: (t3.a = t2.a) + -> Hash Join + Hash Cond: (t3.a = t1.a) + -> Seq Scan on magic_t3 t3 + Filter: (a = a) + -> Hash + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((a = a) AND ((b)::bigint = 10)) -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((a IS NOT NULL) AND ((b)::bigint = 10)) - -> Materialize - -> Seq Scan on magic_t2 t2 - Filter: ((a IS NOT NULL) AND ((b)::bigint = 10)) -(27 rows) + -> HashAggregate + Group By Key: t2.a + -> Seq Scan on magic_t2 t2 + Filter: ((a = a) AND ((b)::bigint = 10)) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint = 10) +(31 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.a = t2.a and t1.b = 10 and t2.b = 10 and t1.c < (select sum(c) from magic_t3 t3 where t1.a = t3.a and t2.a = t3.a) order by 1,2,3,4; - a | b | c | d -----+----+-----+----- - 10 | 10 | 10 | 10 - 10 | 10 | 10 | 110 - 10 | 10 | 10 | 210 - 10 | 10 | 10 | 310 - 10 | 10 | 10 | 410 - 10 | 10 | 110 | 10 - 10 | 10 | 110 | 110 - 10 | 10 | 110 | 210 - 10 | 10 | 110 | 310 - 10 | 10 | 110 | 410 - 10 | 10 | 210 | 10 - 10 | 10 | 210 | 110 - 10 | 10 | 210 | 210 - 10 | 10 | 210 | 310 - 10 | 10 | 210 | 410 -(15 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain (costs off) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.b = t2.b and @@ -2056,77 +1065,67 @@ t1.b = 10 and t2.c = 10 and COALESCE(t1.a::varchar, t1.b) = 10 and COALESCE(t2.a::varchar, t2.b) = 10 and t1.c < (select sum(c) from magic_t3 t3 where t1.a = t3.a and t2.a = t3.a) order by 1,2,3,4; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.d - -> Nested Loop - Join Filter: ((t3.a = t2.a) AND ((t1.b)::text = (t2.b)::text)) - -> Seq Scan on magic_t2 t2 - Filter: ((c = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) - -> Materialize - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Nested Loop - Join Filter: ((t1.c < (sum(t3.c))) AND (t1.a = t3.a)) - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.d + -> Nested Loop + Join Filter: ((t1.c < (sum(t3.c))) AND (t3.a = t1.a) AND ((t2.b)::text = (t1.b)::text)) + -> Hash Join + Hash Cond: (t3.a = t2.a) + -> HashAggregate + Group By Key: t3.a, t3.a + -> Hash Join + Hash Cond: (t3.a = t2.a) + -> Hash Join + Hash Cond: (t3.a = t1.a) + -> Seq Scan on magic_t3 t3 + -> Hash + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) + -> Hash -> HashAggregate - Group By Key: t3.a, t3.a - -> Nested Loop Semi Join - Join Filter: (t3.a = t2.a) - -> Hash Semi Join - Hash Cond: (t3.a = t1.a) - -> Seq Scan on magic_t3 t3 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) - -> Materialize - -> Seq Scan on magic_t2 t2 - Filter: ((c = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) -(29 rows) + Group By Key: t2.a + -> Seq Scan on magic_t2 t2 + Filter: ((c = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) + -> Hash + -> Seq Scan on magic_t2 t2 + Filter: ((c = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint = 10) AND ((COALESCE((a)::character varying, b))::bigint = 10)) +(28 rows) select t2.* from magic_t1 as t1, magic_t2 as t2 where t1.b = t2.b and t1.b = 10 and t2.c = 10 and COALESCE(t1.a::varchar, t1.b) = 10 and COALESCE(t2.a::varchar, t2.b) = 10 and t1.c < (select sum(c) from magic_t3 t3 where t1.a = t3.a and t2.a = t3.a) order by 1,2,3,4; - a | b | c | d -----+----+----+----- - 10 | 10 | 10 | 10 - 10 | 10 | 10 | 110 - 10 | 10 | 10 | 210 - 10 | 10 | 10 | 310 - 10 | 10 | 10 | 410 -(5 rows) + a | b | c | d +---+---+---+--- +(0 rows) explain(costs off) select count(*) from magic_t1 as t1 left join magic_t2 as t2 on t2.c <= (select max(c) from magic_t3 as t3 where t2.a = t3.a) where t2.b is null; - QUERY PLAN -------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - Node/s: All datanodes - -> Aggregate - -> Nested Loop Left Join - Filter: (t2.b IS NULL) - -> Seq Scan on magic_t1 t1 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (t2.a = t3.a) - Join Filter: (t2.c <= (max(t3.c))) - -> Seq Scan on magic_t2 t2 - -> Hash - -> HashAggregate - Group By Key: t3.a - -> Seq Scan on magic_t3 t3 -(18 rows) + -> Nested Loop Left Join + Filter: (t2.b IS NULL) + -> Seq Scan on magic_t1 t1 + -> Materialize + -> Hash Join + Hash Cond: (t2.a = subquery."?column?") + Join Filter: (t2.c <= subquery.max) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t3.a + -> Seq Scan on magic_t3 t3 +(14 rows) select count(*) from magic_t1 as t1 left join magic_t2 as t2 on t2.c <= (select max(c) from magic_t3 as t3 where t2.a = t3.a) where t2.b is null; @@ -2139,39 +1138,37 @@ explain(costs off) select count(*) from magic_t1 as t1 left join magic_t2 as t2 on t2.c <= (select max(c) from magic_t3 as t3 where t2.a = t3.a and t3.a in (select a from magic_t2 as t2 where t2.b is null)) where t2.b is null; - QUERY PLAN -------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------- Aggregate - -> Streaming (type: GATHER) - Node/s: All datanodes - -> Aggregate - -> Nested Loop Left Join - Filter: (t2.b IS NULL) - -> Seq Scan on magic_t1 t1 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (t2.a = t3.a) - Join Filter: (t2.c <= (max(t3.c))) - -> Seq Scan on magic_t2 t2 - -> Hash - -> HashAggregate - Group By Key: t3.a - -> Hash Semi Join - Hash Cond: (t3.a = t2.a) - -> Seq Scan on magic_t3 t3 - -> Hash - -> Seq Scan on magic_t2 t2 - Filter: (b IS NULL) -(23 rows) + -> Nested Loop Left Join + Filter: (t2.b IS NULL) + -> Seq Scan on magic_t1 t1 + -> Materialize + -> Hash Join + Hash Cond: (t2.a = subquery."?column?") + Join Filter: (t2.c <= subquery.max) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t3.a + -> Hash Join + Hash Cond: (t3.a = t2.a) + -> Seq Scan on magic_t3 t3 + -> Hash + -> HashAggregate + Group By Key: t2.a + -> Seq Scan on magic_t2 t2 + Filter: (b IS NULL) +(21 rows) select count(*) from magic_t1 as t1 left join magic_t2 as t2 on t2.c <= (select max(c) from magic_t3 as t3 where t2.a = t3.a and t3.a in (select a from magic_t2 as t2 where t2.b is null)) where t2.b is null; count ------- - 1000 + 0 (1 row) explain (costs off) @@ -2183,35 +1180,32 @@ t1.c < (select sum(c) from magic_t2 as t4 where t1.a = t4.a) order by 1,2,3,4; QUERY PLAN --------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Nested Loop + Join Filter: (t1.a = t2.a) -> Nested Loop - Join Filter: (t1.a = t2.a) - -> Nested Loop - Join Filter: ((t1.c < (sum(t4.c))) AND (t1.a = t4.a)) - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 100) AND ((b)::bigint < 200)) - -> HashAggregate - Group By Key: t4.a - -> Hash Semi Join - Hash Cond: (t4.a = t1.a) - -> Seq Scan on magic_t2 t4 - -> Hash + Join Filter: ((t1.c < (sum(t4.c))) AND (t1.a = t4.a)) + -> HashAggregate + Group By Key: t4.a + -> Hash Join + Hash Cond: (t4.a = t1.a) + -> Seq Scan on magic_t2 t4 + -> Hash + -> HashAggregate + Group By Key: t1.a -> Seq Scan on magic_t1 t1 Filter: (((b)::bigint > 100) AND ((b)::bigint < 200)) + -> Materialize + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 100) AND ((b)::bigint < 200)) + -> Materialize -> Seq Scan on magic_t2 t2 Filter: (SubPlan 1) SubPlan 1 - -> Result - Filter: ((t2.b)::text = (t3.b)::text) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 -(28 rows) + -> Seq Scan on magic_t3 t3 + Filter: ((t2.b)::text = (b)::text) +(25 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.b > 100 and @@ -2227,34 +1221,29 @@ explain(costs off) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) and t1.b > 100 where t1.c < (select sum(c) from magic_t2 as t4 where t1.a = t4.a) and t2.a in (select a from magic_t3 as t3 where t2.b = t3.b)order by 1,2,3,4; - QUERY PLAN ---------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: (t1.a = t2.a) - -> Nested Loop - Join Filter: ((t1.c < (sum(t4.c))) AND (t1.a = t4.a)) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize + QUERY PLAN +---------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + Join Filter: (t1.c < subquery.sum) + -> Hash Join + Hash Cond: (t2.a = subquery."?column?") + -> Seq Scan on magic_t2 t2 + Filter: (SubPlan 1) + SubPlan 1 + -> Seq Scan on magic_t3 t3 + Filter: ((t2.b)::text = (b)::text) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t4.a -> Seq Scan on magic_t2 t4 - -> Materialize - -> Seq Scan on magic_t2 t2 - Filter: (SubPlan 1) - SubPlan 1 - -> Result - Filter: ((t2.b)::text = (t3.b)::text) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 -(25 rows) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) +(20 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) and t1.b > 100 where t1.c < (select sum(c) from magic_t2 as t4 where t1.a = t4.a) and @@ -2268,39 +1257,36 @@ select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c < (select sum(a) from (select a from magic_t3) as t4 where t1.a = t4.a) and t1.b > 100 and t2.a in (select a from magic_t3 as t3 where t2.b = t3.b)order by 1,2,3,4; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: (t1.a = t2.a) - -> Nested Loop - Join Filter: ((t1.c < (sum(magic_t3.a))) AND (t1.a = magic_t3.a)) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize + QUERY PLAN +------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + Join Filter: (t1.c < subquery.sum) + -> Hash Join + Hash Cond: (t2.a = subquery."?column?") + -> Seq Scan on magic_t2 t2 + Filter: (SubPlan 1) + SubPlan 1 + -> Seq Scan on magic_t3 t3 + Filter: ((t2.b)::text = (b)::text) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: magic_t3.a - -> Hash Semi Join + -> Hash Join Hash Cond: (magic_t3.a = t1.a) -> Seq Scan on magic_t3 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize - -> Seq Scan on magic_t2 t2 - Filter: (SubPlan 1) - SubPlan 1 - -> Result - Filter: ((t2.b)::text = (t3.b)::text) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 -(30 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) +(27 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c < (select sum(a) from (select a from magic_t3) as t4 where t1.a = t4.a) and @@ -2315,39 +1301,36 @@ select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c < (select sum(a) from (select a from magic_t3) as t4 where t1.a = t4.a) and t2.a in (select a from magic_t3 as t3 where t2.b = t3.b) and t1.b > 100 order by 1,2,3,4; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: (t1.a = t2.a) - -> Nested Loop - Join Filter: ((t1.c < (sum(magic_t3.a))) AND (t1.a = magic_t3.a)) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize + QUERY PLAN +------------------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + Join Filter: (t1.c < subquery.sum) + -> Hash Join + Hash Cond: (t2.a = subquery."?column?") + -> Seq Scan on magic_t2 t2 + Filter: (SubPlan 1) + SubPlan 1 + -> Seq Scan on magic_t3 t3 + Filter: ((t2.b)::text = (b)::text) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: magic_t3.a - -> Hash Semi Join + -> Hash Join Hash Cond: (magic_t3.a = t1.a) -> Seq Scan on magic_t3 -> Hash - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize - -> Seq Scan on magic_t2 t2 - Filter: (SubPlan 1) - SubPlan 1 - -> Result - Filter: ((t2.b)::text = (t3.b)::text) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 -(30 rows) + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) +(27 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c < (select sum(a) from (select a from magic_t3) as t4 where t1.a = t4.a) and @@ -2362,41 +1345,41 @@ select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c < (select sum(a) from (select a from magic_t3) as t4 where t1.a = t4.a) and t2.a > (select a from magic_t3 as t3 where t2.b = t3.b limit 1) and t1.b > 100 order by 1,2,3,4; - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Nested Loop - Join Filter: (t1.a = t2.a) - -> Nested Loop - Join Filter: ((t1.c < (sum(magic_t3.a))) AND (t1.a = magic_t3.a)) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Materialize - -> HashAggregate - Group By Key: magic_t3.a - -> Hash Semi Join - Hash Cond: (magic_t3.a = t1.a) - -> Seq Scan on magic_t3 - -> Hash + QUERY PLAN +------------------------------------------------------------------------------------------------------ + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Hash Join + Hash Cond: (t1.a = t2.a) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Hash Join + Hash Cond: ((t2.b)::text = subquery."?column?") + Join Filter: (t2.a > subquery.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Subquery Scan on subquery + Filter: (subquery."?column?" OPERATOR(pg_catalog.=) 1::bigint) + -> WindowAgg + -> Sort + Sort Key: ((t3.b)::text) + -> Seq Scan on magic_t3 t3 + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: magic_t3.a + -> Hash Join + Hash Cond: (magic_t3.a = t1.a) + -> Seq Scan on magic_t3 + -> Hash + -> HashAggregate + Group By Key: t1.a -> Seq Scan on magic_t1 t1 Filter: ((b)::bigint > 100) - -> Materialize - -> Seq Scan on magic_t2 t2 - Filter: (a > (SubPlan 1)) - SubPlan 1 - -> Limit - -> Sort - Sort Key: t3.a - -> Result - Filter: ((t2.b)::text = (t3.b)::text) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 (33 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) @@ -2414,87 +1397,30 @@ select t2.* from magic_t1 as t1 full join magic_t2 as t2 on t1.a = t2.a and t1.c < (select max(c) from magic_t3 t3 where t1.a = t3.a) where t1.b > 50 and t1.b < 55 order by 1,2,3,4; - QUERY PLAN -------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - Join Filter: (t1.c < (SubPlan 1)) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) - SubPlan 1 - -> Aggregate - -> Result - Filter: (t1.a = t3.a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 -(20 rows) + QUERY PLAN +------------------------------------------------------------------------- + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Right Join + Hash Cond: (t2.a = t1.a) + Join Filter: (t1.c < (SubPlan 1)) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Seq Scan on magic_t1 t1 + Filter: (((b)::bigint > 50) AND ((b)::bigint < 55)) + SubPlan 1 + -> Aggregate + -> Seq Scan on magic_t3 t3 + Filter: (t1.a = a) +(13 rows) select t2.* from magic_t1 as t1 full join magic_t2 as t2 on t1.a = t2.a and t1.c < (select max(c) from magic_t3 t3 where t1.a = t3.a) where t1.b > 50 and t1.b < 55 order by 1,2,3,4 limit 50; - a | b | c | d -----+-----+-----+----- - 51 | 151 | 51 | 51 - 51 | 151 | 51 | 151 - 51 | 151 | 51 | 251 - 51 | 151 | 51 | 351 - 51 | 151 | 51 | 451 - 51 | 151 | 151 | 51 - 51 | 151 | 151 | 151 - 51 | 151 | 151 | 251 - 51 | 151 | 151 | 351 - 51 | 151 | 151 | 451 - 51 | 151 | 251 | 51 - 51 | 151 | 251 | 151 - 51 | 151 | 251 | 251 - 51 | 151 | 251 | 351 - 51 | 151 | 251 | 451 - 51 | 51 | 51 | 51 - 51 | 51 | 51 | 151 - 51 | 51 | 51 | 251 - 51 | 51 | 51 | 351 - 51 | 51 | 51 | 451 - 51 | 51 | 151 | 51 - 51 | 51 | 151 | 151 - 51 | 51 | 151 | 251 - 51 | 51 | 151 | 351 - 51 | 51 | 151 | 451 - 51 | 51 | 251 | 51 - 51 | 51 | 251 | 151 - 51 | 51 | 251 | 251 - 51 | 51 | 251 | 351 - 51 | 51 | 251 | 451 - 52 | 152 | 52 | 52 - 52 | 152 | 52 | 152 - 52 | 152 | 52 | 252 - 52 | 152 | 52 | 352 - 52 | 152 | 52 | 452 - 52 | 152 | 152 | 52 - 52 | 152 | 152 | 152 - 52 | 152 | 152 | 252 - 52 | 152 | 152 | 352 - 52 | 152 | 152 | 452 - 52 | 152 | 252 | 52 - 52 | 152 | 252 | 152 - 52 | 152 | 252 | 252 - 52 | 152 | 252 | 352 - 52 | 152 | 252 | 452 - 52 | 52 | 52 | 52 - 52 | 52 | 52 | 152 - 52 | 52 | 52 | 252 - 52 | 52 | 52 | 352 - 52 | 52 | 52 | 452 -(50 rows) + a | b | c | d +---+---+---+--- +(0 rows) --not to search join quals, out join can lead to result error explain (costs off) @@ -2502,25 +1428,23 @@ select t2.* from magic_t1 as t1 right join magic_t2 as t2 on (t1.a = t2.a) and t where t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c < (sum(t2.c))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Hash + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a -> Seq Scan on magic_t2 t2 -(18 rows) +(16 rows) select t2.* from magic_t1 as t1 right join magic_t2 as t2 on (t1.a = t2.a) and t1.b > 100 where t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; @@ -2533,41 +1457,29 @@ select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) and t1 where t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4; QUERY PLAN ------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Right Join - Hash Cond: (t2.a = t1.a) - Join Filter: ((t1.b)::bigint > 100) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t2.a) - Join Filter: (t1.c < (sum(t2.c))) - -> Seq Scan on magic_t1 t1 - -> Hash + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Right Join + Hash Cond: (t2.a = t1.a) + Join Filter: ((t1.b)::bigint > 100) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Seq Scan on magic_t1 t1 + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t2.a -> Seq Scan on magic_t2 t2 -(18 rows) +(16 rows) select t2.* from magic_t1 as t1 left join magic_t2 as t2 on (t1.a = t2.a) and t1.b > 100 where t1.c < (select sum(c) from magic_t2 t2 where t1.a = t2.a) order by 1,2,3,4 limit 10; a | b | c | d ---+---+---+--- - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | - | | | -(10 rows) +(0 rows) --expr sublink include any_sublink, can not pull explain(costs off) @@ -2576,21 +1488,19 @@ where t1.c < (select sum(c) from magic_t2 as t4 where t1.a = t4.a and t4.a in (s t1.b > 100 order by 1,2,3,4; QUERY PLAN ---------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.a, t2.b, t2.c, t2.d - Node/s: All datanodes - -> Sort - Sort Key: t2.a, t2.b, t2.c, t2.d - -> Hash Join - Hash Cond: (t2.a = t1.a) - -> Seq Scan on magic_t2 t2 - -> Hash - -> Hash Join - Hash Cond: (t1.a = t4.a) - Join Filter: (t1.c < (sum(t4.c))) - -> Seq Scan on magic_t1 t1 - Filter: ((b)::bigint > 100) - -> Hash + Sort + Sort Key: t2.a, t2.b, t2.c, t2.d + -> Hash Join + Hash Cond: (t2.a = t1.a) + -> Seq Scan on magic_t2 t2 + -> Hash + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Hash + -> Subquery Scan on subquery -> HashAggregate Group By Key: t4.a -> Hash Join @@ -2600,7 +1510,7 @@ t1.b > 100 order by 1,2,3,4; -> HashAggregate Group By Key: magic_t3.a -> Seq Scan on magic_t3 -(24 rows) +(22 rows) select t2.* from magic_t1 as t1 join magic_t2 as t2 on (t1.a = t2.a) where t1.c < (select sum(c) from magic_t2 as t4 where t1.a = t4.a and t4.a in (select a from magic_t3)) and @@ -2615,29 +1525,31 @@ select * from magic_t1 as t1 where t1.c < (select sum(t2.a) from magic_t2 as t2 left join magic_t3 as t3 on (1 = 1) where (t1.a = t3.a)) and t1.b > 100 order by 1,2,3,4; - QUERY PLAN ---------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t1.a, t1.b, t1.c, t1.d - Node/s: All datanodes - -> Sort - Sort Key: t1.a, t1.b, t1.c, t1.d + QUERY PLAN +------------------------------------------------------------------------------- + Sort + Sort Key: t1.a, t1.b, t1.c, t1.d + -> Hash Join + Hash Cond: (t1.a = subquery."?column?") + Join Filter: (t1.c < subquery.sum) -> Seq Scan on magic_t1 t1 - Filter: (((b)::bigint > 100) AND (c < (SubPlan 1))) - SubPlan 1 - -> Aggregate - -> Nested Loop - -> Result - Filter: (t1.a = t3.a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 t3 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t2 t2 -(20 rows) + Filter: ((b)::bigint > 100) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: t3.a + -> Hash Join + Hash Cond: (t1.a = t3.a) + -> Nested Loop + -> HashAggregate + Group By Key: t1.a + -> Seq Scan on magic_t1 t1 + Filter: ((b)::bigint > 100) + -> Materialize + -> Seq Scan on magic_t2 t2 + -> Hash + -> Seq Scan on magic_t3 t3 +(22 rows) select * from magic_t1 as t1 where t1.c < (select sum(t2.a) from magic_t2 as t2 left join magic_t3 as t3 on (1 = 1) where @@ -2650,9 +1562,9 @@ t1.b > 100 order by 1,2,3,4; drop table magic_t1; drop table magic_t2; drop table magic_t3; -create table magic_t1(a int, b int, c int) distribute by hash(a); -create table magic_t2(a int, b int, c int) distribute by hash(a); -create table magic_t3(a int, b int, c int) distribute by hash(a); +create table magic_t1(a int, b int, c int); +create table magic_t2(a int, b int, c int); +create table magic_t3(a int, b int, c int); insert into magic_t1 values(1, 1, 1); insert into magic_t2 values(1, 1, 1); insert into magic_t3 values(1, 1, 1); @@ -2674,10 +1586,10 @@ where t2.b is null; drop table magic_t1; drop table magic_t2; drop table magic_t3; -create table magic_t1(t1_a int, t1_b varchar, t1_c int, t1_d int) distribute by hash(t1_a); -create table magic_t2(t2_a int, t2_b varchar, t2_c int, t2_d int) distribute by hash(t2_a); -create table magic_t3(t3_a int, t3_b varchar, t3_c int, t3_d int) distribute by hash(t3_a); -create table magic_t4(t4_a int, t4_b varchar, t4_c int, t4_d int) distribute by hash(t4_a); +create table magic_t1(t1_a int, t1_b varchar, t1_c int, t1_d int); +create table magic_t2(t2_a int, t2_b varchar, t2_c int, t2_d int); +create table magic_t3(t3_a int, t3_b varchar, t3_c int, t3_d int); +create table magic_t4(t4_a int, t4_b varchar, t4_c int, t4_d int); insert into magic_t1 values(generate_series(1, 100), generate_series(1, 100), generate_series(1, 100), generate_series(1, 100)); insert into magic_t2 values(generate_series(1, 30), generate_series(1, 30), generate_series(1, 30), generate_series(1, 30)); insert into magic_t3 values(generate_series(1, 20), generate_series(1, 20), generate_series(1, 20), generate_series(1, 20)); @@ -2690,28 +1602,27 @@ explain(costs off) select t1_a from magic_t1 join magic_t2 on (t1_a = t2_a) where t1_b < 10 and t1_c = t2_c and t1_d >= (select max(t3_b) from magic_t3 where t3_a = t1_a); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) - -> Hash Join + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (magic_t3.t3_a = magic_set.magic_t1.t1_a) + Join Filter: (magic_set.magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) + -> HashAggregate + Group By Key: magic_t3.t3_a + -> Hash Right Semi Join Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - Join Filter: (magic_set.magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) -> Seq Scan on magic_t1 Filter: ((t1_b)::bigint < 10) -> Hash - -> HashAggregate - Group By Key: magic_t3.t3_a - -> Hash Right Semi Join - Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) - -> Hash - -> Seq Scan on magic_t3 - -> Seq Scan on magic_t2 -(19 rows) + -> Seq Scan on magic_t3 + -> Hash + -> Hash Join + Hash Cond: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Seq Scan on magic_t2 +(18 rows) select t1_a from magic_t1 join magic_t2 on (t1_a = t2_a) where t1_b < 10 and t1_c = t2_c and @@ -2733,34 +1644,32 @@ explain(costs off) select t2_a from magic_t1 join magic_t2 on (t1_a = t2_a) join magic_t3 on(t2_b = t3_b) where t1_b < 10 and t1_c = t2_c and t1_d >= (select max(t4_b) from magic_t4 where t4_a = t1_a); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_t2.t2_b)::text = (magic_t3.t3_b)::text) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t4.t4_a) AND (magic_set.magic_t1.t1_d >= ((max((magic_t4.t4_b)::text)))::bigint)) - -> HashAggregate - Group By Key: magic_t4.t4_a - -> Hash Right Semi Join - Hash Cond: (magic_set.magic_t1.t1_a = magic_t4.t4_a) - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) - -> Hash - -> Seq Scan on magic_t4 - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) - -> Seq Scan on magic_t2 - -> Materialize - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t3 -(25 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: ((magic_t3.t3_b)::text = (magic_t2.t2_b)::text) + -> Seq Scan on magic_t3 + -> Hash + -> Hash Join + Hash Cond: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) + Join Filter: (magic_set.magic_t1.t1_d >= (subquery.max)::bigint) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Hash Join + Hash Cond: (magic_t2.t2_a = subquery."?column?") + -> Seq Scan on magic_t2 + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: magic_t4.t4_a + -> Hash Right Semi Join + Hash Cond: (magic_set.magic_t1.t1_a = magic_t4.t4_a) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Seq Scan on magic_t4 +(23 rows) select t2_a from magic_t1 join magic_t2 on (t1_a = t2_a) join magic_t3 on(t2_b = t3_b) where t1_b < 10 and t1_c = t2_c and @@ -2782,27 +1691,27 @@ explain(costs off) select t1_a from magic_t1 join magic_t2 on (t1_a = t2_a) where case when t1_b < 10 then true else false end and t1_c = t2_c and t1_d >= (select max(t3_b) from magic_t3 where t3_a = t1_a); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: ((magic_t2.t2_a = magic_set.magic_t1.t1_a) AND (magic_t2.t2_c = magic_set.magic_t1.t1_c)) + -> Seq Scan on magic_t2 + -> Hash -> Hash Join - Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - Join Filter: (magic_set.magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) + Hash Cond: (magic_set.magic_t1.t1_a = subquery."?column?") + Join Filter: (magic_set.magic_t1.t1_d >= (subquery.max)::bigint) -> Seq Scan on magic_t1 Filter: CASE WHEN ((t1_b)::bigint < 10) THEN true ELSE false END -> Hash - -> HashAggregate - Group By Key: magic_t3.t3_a - -> Hash Right Semi Join - Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - -> Seq Scan on magic_t1 - Filter: CASE WHEN ((t1_b)::bigint < 10) THEN true ELSE false END - -> Hash - -> Seq Scan on magic_t3 - -> Seq Scan on magic_t2 + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: magic_t3.t3_a + -> Hash Right Semi Join + Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) + -> Seq Scan on magic_t1 + Filter: CASE WHEN ((t1_b)::bigint < 10) THEN true ELSE false END + -> Hash + -> Seq Scan on magic_t3 (19 rows) select t1_a from magic_t1 join magic_t2 on (t1_a = t2_a) @@ -2825,28 +1734,27 @@ explain(costs off) select t1_a from magic_t1 left join magic_t2 on (t1_a = t2_a) where t1_b < 10 and t1_c = t2_c and t1_d >= (select max(t3_b) from magic_t3 where t3_a = t1_a); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) - -> Hash Join + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: (magic_t3.t3_a = magic_set.magic_t1.t1_a) + Join Filter: (magic_set.magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) + -> HashAggregate + Group By Key: magic_t3.t3_a + -> Hash Right Semi Join Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - Join Filter: (magic_set.magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) -> Seq Scan on magic_t1 Filter: ((t1_b)::bigint < 10) -> Hash - -> HashAggregate - Group By Key: magic_t3.t3_a - -> Hash Right Semi Join - Hash Cond: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) - -> Hash - -> Seq Scan on magic_t3 - -> Seq Scan on magic_t2 -(19 rows) + -> Seq Scan on magic_t3 + -> Hash + -> Hash Join + Hash Cond: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Seq Scan on magic_t2 +(18 rows) select t1_a from magic_t1 left join magic_t2 on (t1_a = t2_a) where t1_b < 10 and t1_c = t2_c and @@ -2867,71 +1775,73 @@ t1_d >= (select max(t3_b) from magic_t3 where t3_a = t1_a)order by t1_a; explain(costs off) select 1 from magic_t1 left join magic_t2 on (t1_a = t2_a and t2_d >=(select max(t3_b) from magic_t3 where t3_a = t2_a)) where t1_b < 10 and t1_c = t2_c; - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_t3.t3_a = magic_t1.t1_a) AND (magic_t2.t2_c = magic_t1.t1_c)) - -> Nested Loop - Join Filter: ((magic_t2.t2_a = magic_t3.t3_a) AND (magic_t2.t2_d >= ((max((magic_t3.t3_b)::text)))::bigint)) - -> Seq Scan on magic_t2 - -> Materialize - -> HashAggregate - Group By Key: magic_t3.t3_a - -> Seq Scan on magic_t3 - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) + QUERY PLAN +------------------------------------------------------------------------------------------------ + Hash Join + Hash Cond: (magic_t3.t3_a = magic_t2.t2_a) + Join Filter: (magic_t2.t2_d >= ((max((magic_t3.t3_b)::text)))::bigint) + -> HashAggregate + Group By Key: magic_t3.t3_a + -> Seq Scan on magic_t3 + -> Hash + -> Hash Join + Hash Cond: ((magic_t1.t1_a = magic_t2.t2_a) AND (magic_t1.t1_c = magic_t2.t2_c)) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Seq Scan on magic_t2 (13 rows) explain(costs off) select 1 from magic_t1 right join magic_t2 on (t1_a = t2_a and t1_d >=(select max(t3_b) from magic_t3 where t3_a = t1_a)) where t1_b < 10 and t1_c = t2_c; - QUERY PLAN --------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_t3.t3_a = magic_t2.t2_a) AND (magic_t1.t1_c = magic_t2.t2_c)) + QUERY PLAN +------------------------------------------------------------------------------------------------ + Hash Join + Hash Cond: (magic_t3.t3_a = magic_t1.t1_a) + Join Filter: (magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) + -> HashAggregate + Group By Key: magic_t3.t3_a + -> Seq Scan on magic_t3 + -> Hash -> Hash Join - Hash Cond: (magic_t1.t1_a = magic_t3.t3_a) - Join Filter: (magic_t1.t1_d >= ((max((magic_t3.t3_b)::text)))::bigint) + Hash Cond: ((magic_t1.t1_a = magic_t2.t2_a) AND (magic_t1.t1_c = magic_t2.t2_c)) -> Seq Scan on magic_t1 Filter: ((t1_b)::bigint < 10) -> Hash - -> HashAggregate - Group By Key: magic_t3.t3_a - -> Seq Scan on magic_t3 - -> Seq Scan on magic_t2 -(14 rows) + -> Seq Scan on magic_t2 +(13 rows) explain(costs off) select t2_b from magic_t1 left join magic_t2 on (t1_a = t2_a) join magic_t3 on (t2_a = t3_a and t1_d >=(select max(t4_b) from magic_t4 where t4_a = t1_a)) where t1_b < 10 and t1_c = t2_c; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: (magic_set.magic_t1.t1_a = magic_t3.t3_a) - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t2.t2_a) AND (magic_set.magic_t1.t1_c = magic_t2.t2_c)) - -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_a = magic_t4.t4_a) AND (magic_set.magic_t1.t1_d >= ((max((magic_t4.t4_b)::text)))::bigint)) - -> HashAggregate - Group By Key: magic_t4.t4_a - -> Hash Right Semi Join - Hash Cond: (magic_set.magic_t1.t1_a = magic_t4.t4_a) - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) - -> Hash - -> Seq Scan on magic_t4 - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint < 10) - -> Seq Scan on magic_t2 - -> Seq Scan on magic_t3 -(20 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------- + Hash Join + Hash Cond: ((magic_t2.t2_a = magic_set.magic_t1.t1_a) AND (magic_t2.t2_c = magic_set.magic_t1.t1_c)) + -> Seq Scan on magic_t2 + -> Hash + -> Hash Join + Hash Cond: (magic_t3.t3_a = magic_set.magic_t1.t1_a) + -> Seq Scan on magic_t3 + -> Hash + -> Hash Join + Hash Cond: (magic_set.magic_t1.t1_a = subquery."?column?") + Join Filter: (magic_set.magic_t1.t1_d >= (subquery.max)::bigint) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: magic_t4.t4_a + -> Hash Right Semi Join + Hash Cond: (magic_set.magic_t1.t1_a = magic_t4.t4_a) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint < 10) + -> Hash + -> Seq Scan on magic_t4 +(23 rows) select t2_b from magic_t1 left join magic_t2 on (t1_a = t2_a) join magic_t3 on (t2_a = t3_a and t1_d >=(select max(t4_b) from magic_t4 where t4_a = t1_a)) @@ -2953,29 +1863,28 @@ explain(costs off) select t1_a from magic_t1 join (select t2_a, t2_b from magic_t2, magic_t3 where t2_a = t3_a) as AA on (t1_a = t2_a) where t2_a < 10 and t1_d >=(select max(t4_b) from magic_t4 where t4_a = t2_b); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: ((magic_t1.t1_d >= ((max((magic_t4.t4_b)::text)))::bigint) AND (((magic_t2.t2_b)::bigint) = magic_t4.t4_a)) - -> HashAggregate - Group By Key: magic_t4.t4_a - -> Seq Scan on magic_t4 - -> Materialize - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Nested Loop - Join Filter: (magic_t2.t2_a = magic_t3.t3_a) - -> Nested Loop - Join Filter: (magic_t1.t1_a = magic_t2.t2_a) - -> Seq Scan on magic_t1 - Filter: (t1_a < 10) - -> Seq Scan on magic_t2 - Filter: (t2_a < 10) - -> Seq Scan on magic_t3 - Filter: (t3_a < 10) -(20 rows) + QUERY PLAN +-------------------------------------------------------------------------------- + Nested Loop + Join Filter: (magic_t2.t2_a = magic_t3.t3_a) + -> Hash Join + Hash Cond: (magic_t1.t1_a = magic_t2.t2_a) + Join Filter: (magic_t1.t1_d >= (subquery.max)::bigint) + -> Seq Scan on magic_t1 + Filter: (t1_a < 10) + -> Hash + -> Hash Join + Hash Cond: ((magic_t2.t2_b)::bigint = subquery."?column?") + -> Seq Scan on magic_t2 + Filter: (t2_a < 10) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: magic_t4.t4_a + -> Seq Scan on magic_t4 + -> Seq Scan on magic_t3 + Filter: (t3_a < 10) +(19 rows) select t1_a from magic_t1 join (select t2_a, t2_b from magic_t2, magic_t3 where t2_a = t3_a) as AA on (t1_a = t2_a) where t2_a < 10 and @@ -2998,46 +1907,37 @@ select magic_t2.* from magic_t1 join magic_t2 on (1 = 1) where t1_c < (select sum(t3_a) from magic_t3 where t1_a = t3_a and t1_b = t3_b) and t2_a > (select max(t4_a) from magic_t4 where t2_b = t4_b and t2_c = t4_c) and t1_b > 100 and t1_b = t1_a and t2_a > 10 and t2_d > 20; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Nested Loop + Join Filter: ((magic_set.magic_t1.t1_c < (sum(magic_t3.t3_a))) AND (magic_set.magic_t1.t1_a = magic_t3.t3_a) AND ((magic_set.magic_t1.t1_b)::text = ((magic_t3.t3_b)::text))) -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_c < (sum(magic_t3.t3_a))) AND (magic_set.magic_t1.t1_a = magic_t3.t3_a) AND ((magic_set.magic_t1.t1_b)::text = ((magic_t3.t3_b)::text))) - -> Nested Loop + -> Hash Join + Hash Cond: (((magic_set.magic_t2.t2_b)::text = subquery."?column?") AND (magic_set.magic_t2.t2_c = subquery."?column?")) + Join Filter: (magic_set.magic_t2.t2_a > subquery.max) + -> Seq Scan on magic_t2 + Filter: ((t2_a > 10) AND (t2_d > 20)) + -> Hash + -> Subquery Scan on subquery + -> HashAggregate + Group By Key: (magic_t4.t4_b)::text, magic_t4.t4_c + -> Hash Semi Join + Hash Cond: (((magic_t4.t4_b)::text = (magic_set.magic_t2.t2_b)::text) AND (magic_t4.t4_c = magic_set.magic_t2.t2_c)) + -> Seq Scan on magic_t4 + -> Hash + -> Seq Scan on magic_t2 + Filter: ((t2_a > 10) AND (t2_d > 20)) + -> Seq Scan on magic_t1 + Filter: ((t1_a > 100) AND ((t1_b)::bigint > 100) AND (t1_a = (t1_b)::bigint)) + -> HashAggregate + Group By Key: magic_t3.t3_a, (magic_t3.t3_b)::text + -> Nested Loop Semi Join + Join Filter: ((magic_t3.t3_a = magic_set.magic_t1.t1_a) AND ((magic_t3.t3_b)::text = (magic_set.magic_t1.t1_b)::text)) + -> Seq Scan on magic_t3 + Filter: (t3_a > 100) -> Seq Scan on magic_t1 Filter: ((t1_a > 100) AND ((t1_b)::bigint > 100) AND ((t1_b)::bigint = t1_a)) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Nested Loop - Join Filter: ((magic_set.magic_t2.t2_a > (max(magic_t4.t4_a))) AND ((magic_set.magic_t2.t2_b)::text = ((magic_t4.t4_b)::text)) AND (magic_set.magic_t2.t2_c = magic_t4.t4_c)) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t2 - Filter: ((t2_a > 10) AND (t2_d > 20)) - -> Materialize - -> HashAggregate - Group By Key: (magic_t4.t4_b)::text, magic_t4.t4_c - -> Nested Loop Semi Join - Join Filter: ((magic_t4.t4_c = magic_set.magic_t2.t2_c) AND ((magic_t4.t4_b)::text = (magic_set.magic_t2.t2_b)::text)) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t4 - -> Materialize - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t2 - Filter: ((t2_a > 10) AND (t2_d > 20)) - -> HashAggregate - Group By Key: magic_t3.t3_a, (magic_t3.t3_b)::text - -> Nested Loop Semi Join - Join Filter: ((magic_t3.t3_a = magic_set.magic_t1.t1_a) AND ((magic_t3.t3_b)::text = (magic_set.magic_t1.t1_b)::text)) - -> Seq Scan on magic_t3 - Filter: (t3_a > 100) - -> Seq Scan on magic_t1 - Filter: ((t1_a > 100) AND ((t1_b)::bigint > 100) AND ((t1_b)::bigint = t1_a)) -(37 rows) +(28 rows) select magic_t2.* from magic_t1 join magic_t2 on (1 = 1) where t1_c < (select sum(t3_a) from magic_t3 where t1_a = t3_a and t1_b = t3_b) and @@ -3051,31 +1951,26 @@ explain (costs off) select magic_t2.* from magic_t1, magic_t2 where t1_a = t2_a and t1_b = 10 and t2_b = 10 and t1_a = 10 and t1_c < (select sum(t3_c) from magic_t3 where t1_a = t3_a and t2_a = t3_a); - QUERY PLAN ---------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: datanode10 + QUERY PLAN +--------------------------------------------------------------------------- + Nested Loop + Join Filter: (magic_set.magic_t1.t1_c < (sum(magic_t3.t3_c))) -> Nested Loop - Join Filter: (magic_set.magic_t1.t1_c < (sum(magic_t3.t3_c))) - -> Nested Loop - -> Seq Scan on magic_t1 - Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) + -> Seq Scan on magic_t1 + Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) + -> Seq Scan on magic_t2 + Filter: ((t2_a = 10) AND ((t2_b)::bigint = 10)) + -> GroupAggregate + Group By Key: magic_t3.t3_a, magic_t3.t3_a + -> Nested Loop Semi Join + -> Nested Loop Semi Join + -> Seq Scan on magic_t3 + Filter: (t3_a = 10) + -> Seq Scan on magic_t1 + Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) -> Seq Scan on magic_t2 Filter: ((t2_a = 10) AND ((t2_b)::bigint = 10)) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: datanode10 - -> HashAggregate - Group By Key: magic_t3.t3_a, magic_t3.t3_a - -> Nested Loop Semi Join - -> Nested Loop Semi Join - -> Seq Scan on magic_t3 - Filter: (t3_a = 10) - -> Seq Scan on magic_t1 - Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) - -> Seq Scan on magic_t2 - Filter: ((t2_a = 10) AND ((t2_b)::bigint = 10)) -(22 rows) +(17 rows) select magic_t2.* from magic_t1, magic_t2 where t1_a = t2_a and t1_b = 10 and t2_b = 10 and t1_a = 10 and @@ -3088,83 +1983,67 @@ explain (costs off) select magic_t2.* from magic_t1, magic_t2 where t1_a = t2_a and t1_b = 10 and t2_b = 10 and t1_a = 10 and t1_c < (select sum(t3_c) from magic_t3 where t1_a = t3_a + t3_b); - QUERY PLAN ---------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes + QUERY PLAN +--------------------------------------------------------------------- + Nested Loop + Join Filter: (magic_set.magic_t1.t1_c < (sum(magic_t3.t3_c))) -> Nested Loop - -> Nested Loop - Join Filter: (magic_set.magic_t1.t1_c < (sum(magic_t3.t3_c))) - -> Streaming(type: BROADCAST) - Spawn on: datanode10 - -> Seq Scan on magic_t1 - Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) - -> Materialize - -> HashAggregate - Group By Key: ((magic_t3.t3_a + (magic_t3.t3_b)::bigint)) - -> Nested Loop Semi Join - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - Filter: ((t3_a + (t3_b)::bigint) = 10) - -> Seq Scan on magic_t1 - Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) + -> Seq Scan on magic_t1 + Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) -> Seq Scan on magic_t2 Filter: ((t2_a = 10) AND ((t2_b)::bigint = 10)) -(21 rows) + -> GroupAggregate + Group By Key: (magic_t3.t3_a + (magic_t3.t3_b)::bigint) + -> Nested Loop Semi Join + -> Seq Scan on magic_t3 + Filter: ((t3_a + (t3_b)::bigint) = 10) + -> Seq Scan on magic_t1 + Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) +(14 rows) explain (costs off) select magic_t2.* from magic_t1, magic_t2 where t1_a = t2_a and t1_b = 10 and t2_b = 10 and t1_c < (select sum(t3_c) from magic_t3 where t1_a = t3_a + t3_b); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Node/s: All datanodes + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------- + Nested Loop + Join Filter: ((magic_set.magic_t1.t1_c < (sum(magic_t3.t3_c))) AND (magic_set.magic_t1.t1_a = ((magic_t3.t3_a + (magic_t3.t3_b)::bigint)))) -> Nested Loop - Join Filter: ((magic_set.magic_t1.t1_c < (sum(magic_t3.t3_c))) AND (magic_set.magic_t1.t1_a = ((magic_t3.t3_a + (magic_t3.t3_b)::bigint)))) - -> Nested Loop - Join Filter: (magic_set.magic_t1.t1_a = magic_t2.t2_a) - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint = 10) - -> Seq Scan on magic_t2 - Filter: ((t2_b)::bigint = 10) - -> Materialize - -> HashAggregate - Group By Key: ((magic_t3.t3_a + (magic_t3.t3_b)::bigint)) - -> Nested Loop Semi Join - Join Filter: (((magic_t3.t3_a + (magic_t3.t3_b)::bigint)) = magic_set.magic_t1.t1_a) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - -> Materialize - -> Seq Scan on magic_t1 - Filter: ((t1_b)::bigint = 10) -(21 rows) + Join Filter: (magic_set.magic_t1.t1_a = magic_t2.t2_a) + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint = 10) + -> Seq Scan on magic_t2 + Filter: ((t2_b)::bigint = 10) + -> HashAggregate + Group By Key: (magic_t3.t3_a + (magic_t3.t3_b)::bigint) + -> Hash Semi Join + Hash Cond: ((magic_t3.t3_a + (magic_t3.t3_b)::bigint) = magic_set.magic_t1.t1_a) + -> Seq Scan on magic_t3 + -> Hash + -> Seq Scan on magic_t1 + Filter: ((t1_b)::bigint = 10) +(16 rows) explain (costs off) select magic_t2.* from magic_t1, magic_t2 where t1_a = t2_a and t1_b = 10 and t2_b = 10 and t1_a = 10 and t1_c < (select sum(t3_c) from magic_t3 where t1_a + t2_a = t3_a); - QUERY PLAN ---------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (((magic_t1.t1_a + magic_t2.t2_a)) = magic_t3.t3_a) - Join Filter: (magic_t1.t1_c < (sum(magic_t3.t3_c))) - -> Streaming(type: REDISTRIBUTE) - Spawn on: datanode10 - -> Nested Loop - -> Seq Scan on magic_t1 - Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) - -> Seq Scan on magic_t2 - Filter: ((t2_a = 10) AND ((t2_b)::bigint = 10)) - -> Hash - -> HashAggregate - Group By Key: magic_t3.t3_a - -> Seq Scan on magic_t3 -(16 rows) + QUERY PLAN +--------------------------------------------------------------------- + Hash Join + Hash Cond: (magic_t3.t3_a = (magic_t1.t1_a + magic_t2.t2_a)) + Join Filter: (magic_t1.t1_c < (sum(magic_t3.t3_c))) + -> HashAggregate + Group By Key: magic_t3.t3_a + -> Seq Scan on magic_t3 + -> Hash + -> Nested Loop + -> Seq Scan on magic_t1 + Filter: ((t1_a = 10) AND ((t1_b)::bigint = 10)) + -> Seq Scan on magic_t2 + Filter: ((t2_a = 10) AND ((t2_b)::bigint = 10)) +(12 rows) select magic_t2.* from magic_t1, magic_t2 where t1_a = t2_a and t1_b = 10 and t2_b = 10 and t1_a = 10 and @@ -3179,36 +2058,24 @@ select 1 from magic_t1, magic_t2 where t1_a in (select max(t3_a) from magic_t3 where t3_a = t2_a and t3_b = (select avg(t4_a) from magic_t4 where t3_c = t4_c)); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: (SubPlan 1) - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 - -> Materialize - -> Seq Scan on magic_t2 - SubPlan 1 - -> Aggregate - -> Nested Loop - Join Filter: ((magic_t3.t3_c = magic_t4.t4_c) AND ((magic_t3.t3_b)::numeric = (avg(magic_t4.t4_a)))) - -> Result - Filter: (magic_t3.t3_a = magic_t2.t2_a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> HashAggregate - Group By Key: magic_t4.t4_c - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t4 -(27 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Nested Loop + Join Filter: (SubPlan 1) + -> Seq Scan on magic_t1 + -> Materialize + -> Seq Scan on magic_t2 + SubPlan 1 + -> Aggregate + -> Hash Join + Hash Cond: ((magic_t4.t4_c = magic_t3.t3_c) AND ((avg(magic_t4.t4_a)) = (magic_t3.t3_b)::numeric)) + -> HashAggregate + Group By Key: magic_t4.t4_c + -> Seq Scan on magic_t4 + -> Hash + -> Seq Scan on magic_t3 + Filter: (t3_a = magic_t2.t2_a) +(15 rows) select t1_a from magic_t1, magic_t2 where t1_a in @@ -3236,57 +2103,37 @@ and t3_b = (select avg(t4_a) from magic_t4 where t3_c = t4_c) union all select max(t3_a) from magic_t3 where t3_a = t2_a and t2_a = 1 and t3_b = (select avg(t4_a) from magic_t4 where t3_c = t4_c)); - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: (SubPlan 1) - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 - -> Materialize - -> Seq Scan on magic_t2 - SubPlan 1 - -> Result - -> Append - -> Aggregate - -> Nested Loop - Join Filter: ((magic_set.magic_t3.t3_c = magic_set.magic_t4.t4_c) AND ((magic_set.magic_t3.t3_b)::numeric = (avg(magic_set.magic_t4.t4_a)))) - -> Result - Filter: (magic_set.magic_t3.t3_a = magic_t2.t2_a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> HashAggregate - Group By Key: magic_set.magic_t4.t4_c - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t4 - -> Aggregate - -> Result - One-Time Filter: (magic_t2.t2_a = 1) - -> Nested Loop - Join Filter: ((magic_set.magic_t3.t3_c = magic_set.magic_t4.t4_c) AND ((magic_set.magic_t3.t3_b)::numeric = (avg(magic_set.magic_t4.t4_a)))) - -> Result - Filter: (magic_set.magic_t3.t3_a = magic_t2.t2_a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> HashAggregate - Group By Key: magic_set.magic_t4.t4_c - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t4 -(48 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ + Nested Loop + Join Filter: (SubPlan 1) + -> Seq Scan on magic_t1 + -> Materialize + -> Seq Scan on magic_t2 + SubPlan 1 + -> Result + -> Append + -> Aggregate + -> Hash Join + Hash Cond: ((magic_set.magic_t4.t4_c = magic_set.magic_t3.t3_c) AND ((avg(magic_set.magic_t4.t4_a)) = (magic_set.magic_t3.t3_b)::numeric)) + -> HashAggregate + Group By Key: magic_set.magic_t4.t4_c + -> Seq Scan on magic_t4 + -> Hash + -> Seq Scan on magic_t3 + Filter: (t3_a = magic_t2.t2_a) + -> Aggregate + -> Result + One-Time Filter: (magic_t2.t2_a = 1) + -> Hash Join + Hash Cond: ((magic_set.magic_t4.t4_c = magic_set.magic_t3.t3_c) AND ((avg(magic_set.magic_t4.t4_a)) = (magic_set.magic_t3.t3_b)::numeric)) + -> HashAggregate + Group By Key: magic_set.magic_t4.t4_c + -> Seq Scan on magic_t4 + -> Hash + -> Seq Scan on magic_t3 + Filter: (t3_a = magic_t2.t2_a) +(28 rows) select t1_a from magic_t1, magic_t2 where t1_a in @@ -3315,36 +2162,24 @@ select 1 from magic_t1 join magic_t2 on(1 = 1) where t1_a in (select max(t3_a) from magic_t3 where t3_a = t2_a and t3_b = (select avg(t4_a) from magic_t4 where t3_c = t4_c)); - QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: (SubPlan 1) - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 - -> Materialize - -> Seq Scan on magic_t2 - SubPlan 1 - -> Aggregate - -> Nested Loop - Join Filter: ((magic_t3.t3_c = magic_t4.t4_c) AND ((magic_t3.t3_b)::numeric = (avg(magic_t4.t4_a)))) - -> Result - Filter: (magic_t3.t3_a = magic_t2.t2_a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> HashAggregate - Group By Key: magic_t4.t4_c - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t4 -(27 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------- + Nested Loop + Join Filter: (SubPlan 1) + -> Seq Scan on magic_t1 + -> Materialize + -> Seq Scan on magic_t2 + SubPlan 1 + -> Aggregate + -> Hash Join + Hash Cond: ((magic_t4.t4_c = magic_t3.t3_c) AND ((avg(magic_t4.t4_a)) = (magic_t3.t3_b)::numeric)) + -> HashAggregate + Group By Key: magic_t4.t4_c + -> Seq Scan on magic_t4 + -> Hash + -> Seq Scan on magic_t3 + Filter: (t3_a = magic_t2.t2_a) +(15 rows) select t1_a from magic_t1 join magic_t2 on(1 = 1) where t1_a in @@ -3370,44 +2205,28 @@ select 1 from magic_t1 join magic_t2 on(1 = 1) where t1_a in (select max(t3_a) from magic_t3 where t3_a = t2_a and t3_b < 100 and t3_b = (select avg(t4_a) from magic_t4 where t3_c = t4_c)); - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Nested Loop - Join Filter: (SubPlan 1) - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t1 - -> Materialize - -> Seq Scan on magic_t2 - SubPlan 1 - -> Aggregate - -> Nested Loop - Join Filter: ((magic_set.magic_t3.t3_c = magic_t4.t4_c) AND ((magic_set.magic_t3.t3_b)::numeric = (avg(magic_t4.t4_a)))) - -> Result - Filter: (magic_set.magic_t3.t3_a = magic_t2.t2_a) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - Filter: ((t3_b)::bigint < 100) - -> Materialize - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> HashAggregate - Group By Key: magic_t4.t4_c - -> Nested Loop Semi Join - Join Filter: (magic_t4.t4_c = magic_set.magic_t3.t3_c) - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t4 - -> Materialize - -> Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> Seq Scan on magic_t3 - Filter: ((t3_b)::bigint < 100) -(35 rows) + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------ + Nested Loop + Join Filter: (SubPlan 1) + -> Seq Scan on magic_t1 + -> Materialize + -> Seq Scan on magic_t2 + SubPlan 1 + -> Aggregate + -> Nested Loop + Join Filter: ((magic_set.magic_t3.t3_c = magic_t4.t4_c) AND ((magic_set.magic_t3.t3_b)::numeric = (avg(magic_t4.t4_a)))) + -> Seq Scan on magic_t3 + Filter: ((t3_a = magic_t2.t2_a) AND ((t3_b)::bigint < 100)) + -> HashAggregate + Group By Key: magic_t4.t4_c + -> Hash Semi Join + Hash Cond: (magic_t4.t4_c = magic_set.magic_t3.t3_c) + -> Seq Scan on magic_t4 + -> Hash + -> Seq Scan on magic_t3 + Filter: ((t3_b)::bigint < 100) +(19 rows) select t1_a from magic_t1 join magic_t2 on(1 = 1) where t1_a in diff --git a/src/test/regress/expected/parse_page.out b/src/test/regress/expected/parse_page.out index 501d1f045..a2f995dad 100644 --- a/src/test/regress/expected/parse_page.out +++ b/src/test/regress/expected/parse_page.out @@ -37,51 +37,39 @@ END; $$ ; SELECT gs_parse_page_bypath_test('test_astore', 0, 'heap', true); ---?.* ---?.* ---?.* + gs_parse_page_bypath_test +----------------------------------------------------------------------------------------------- + /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/1663_16384_16387_0.page (1 row) SELECT gs_parse_page_bypath_test('test_segment', 0, 'segment', true); ---?.* ---?.* ---?.* + gs_parse_page_bypath_test +---------------------------------------------------------------------------------------------- + /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/1663_16384_4157_0.page (1 row) CHECKPOINT; SELECT gs_parse_page_bypath_test('test_astore', -1, 'heap', true); ---?.* ---?.* ---?.* -(1 row) - +ERROR: could not read block 2 in file "base/16384/16387": read only 0 of 8192 bytes +CONTEXT: referenced column: gs_parse_page_bypath +PL/pgSQL function gs_parse_page_bypath_test(character varying,integer,character varying,boolean) line 6 at RETURN QUERY +referenced column: gs_parse_page_bypath_test SELECT gs_parse_page_bypath_test('test_astore_idx', 1, 'btree', false); ---?.* ---?.* ---?.* -(1 row) - +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] SELECT gs_parse_page_bypath_test('test_ustore', -1, 'uheap', false); ---?.* ---?.* ---?.* -(1 row) - +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] SELECT gs_parse_page_bypath_test('test_ustore_idx', 1, 'ubtree', false); ---?.* ---?.* ---?.* -(1 row) - +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] SELECT gs_parse_page_bypath_test('test_segment', 0, 'segment', false); ---?.* ---?.* ---?.* -(1 row) - +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] DROP INDEX IF EXISTS test_astore_idx; +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] DROP TABLE IF EXISTS test_astore; +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] DROP INDEX IF EXISTS test_ustore_idx; +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] DROP TABLE IF EXISTS test_ustore; +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] DROP TABLE IF EXISTS test_segment; +ERROR: current transaction is aborted, commands ignored until end of transaction block, firstChar[Q] COMMIT; diff --git a/src/test/regress/expected/partition_cost_model.out b/src/test/regress/expected/partition_cost_model.out index 948806e70..b9f274d4a 100644 --- a/src/test/regress/expected/partition_cost_model.out +++ b/src/test/regress/expected/partition_cost_model.out @@ -21,15 +21,12 @@ insert into test_range_pt select * from test_range_pt; create index idx_local on test_range_pt(a) local; analyze test_range_pt; explain (costs off) select *from test_range_pt where a = 1; - QUERY PLAN --------------------------------------------------- - Partitioned Bitmap Heap Scan on test_range_pt - Recheck Cond: (a = 1) + QUERY PLAN +--------------------------------------------------------- + Partitioned Index Scan using idx_local on test_range_pt + Index Cond: (a = 1) Selected Partitions: 1 - -> Partitioned Bitmap Index Scan on idx_local - Index Cond: (a = 1) - Selected Partitions: 1 -(6 rows) +(3 rows) explain (costs off) select /*+ set(partition_page_estimation on) */*from test_range_pt where a = 1; QUERY PLAN @@ -87,7 +84,7 @@ explain (costs off, verbose on) select a,b,c from test_hash_ht where a = 50; Partitioned Seq Scan on partition_cost_model.test_hash_ht Output: a, b, c Filter: (test_hash_ht.a = 50) - Selected Partitions: 11 + Selected Partitions: 10 (4 rows) explain (costs off, verbose on) select /*+indexscan(test_hash_ht idx_hash_global)*/ a,b,c from test_hash_ht where a = 50; @@ -113,7 +110,7 @@ explain (costs off, verbose on) select a,b,c from test_hash_ht where a = 50; Partitioned Seq Scan on partition_cost_model.test_hash_ht Output: a, b, c Filter: (test_hash_ht.a = 50) - Selected Partitions: 11 + Selected Partitions: 10 (4 rows) explain (costs off, verbose on) select /*+indexscan(test_hash_ht idx_hash_global)*/ a,b,c from test_hash_ht where a = 50; @@ -226,15 +223,19 @@ CREATE INDEX range_list_idx ON range_list(month_code) LOCAL ); set partition_page_estimation = off; explain (costs off) select * from range_list where month_code = '201902'; - QUERY PLAN -------------------------------------------------------- + QUERY PLAN +----------------------------------------------------------------- Partition Iterator Iterations: 1, Sub Iterations: 2 - -> Partitioned Seq Scan on range_list - Filter: ((month_code)::text = '201902'::text) + -> Partitioned Bitmap Heap Scan on range_list + Recheck Cond: ((month_code)::text = '201902'::text) Selected Partitions: 1 Selected Subpartitions: ALL -(6 rows) + -> Partitioned Bitmap Index Scan on range_list_idx + Index Cond: ((month_code)::text = '201902'::text) + Selected Partitions: 1 + Selected Subpartitions: ALL +(10 rows) explain (costs off) select /*+ set(partition_page_estimation on)*/* from range_list where month_code = '201902'; QUERY PLAN diff --git a/src/test/regress/expected/rowlevelsecurity.out b/src/test/regress/expected/rowlevelsecurity.out index 559192e55..fff83ec71 100644 --- a/src/test/regress/expected/rowlevelsecurity.out +++ b/src/test/regress/expected/rowlevelsecurity.out @@ -272,12 +272,13 @@ CREATE ROW LEVEL SECURITY POLICY p06 ON document_row AS RESTRICTIVE FOR SELECT T Indexes: "document_row_pkey" PRIMARY KEY, btree (did) TABLESPACE pg_default Row Level Security Policies: - POLICY "p01" + POLICY "p01" FOR ALL + TO public USING ((dlevel <= (SELECT account_row.aid FROM account_row WHERE ((account_row.aname)::name = "current_user"())))) - POLICY "p02" AS RESTRICTIVE + POLICY "p02" AS RESTRICTIVE FOR ALL TO regress_rls_david USING ((cid < 50)) - POLICY "p03" AS RESTRICTIVE + POLICY "p03" AS RESTRICTIVE FOR ALL TO regress_rls_david USING ((cid <> 44)) POLICY "p04" AS RESTRICTIVE FOR UPDATE @@ -434,27 +435,27 @@ NOTICE: f_leak => regress_rls_bob -- EXPLAIN (COSTS OFF, VERBOSE ON) SELECT * FROM document_row INNER JOIN category_row ON document_row.cid=category_row.cid WHERE rls_fleak2(dauthor) ORDER BY did; \d - List of relations - Schema | Name | Type | Owner | Storage ---------------------+----------------+-------+-------------------+-------------------------------------------------------------- - regress_rls_schema | account_col | table | regress_rls_alice | {orientation=column,compression=low} - regress_rls_schema | account_row | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | alice_public_1 | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | category_col | table | regress_rls_alice | {orientation=column,compression=low} - regress_rls_schema | category_row | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | document_col | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | document_row | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | par_col_t1 | table | regress_rls_alice | {orientation=column,compression=low,enable_rowsecurity=true} - regress_rls_schema | par_row_t1 | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | tt_rep | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} + List of relations + Schema | Name | Type | Owner | Storage +--------------------+----------------+-------+-------+-------------------------------------------------------------- + regress_rls_schema | account_col | table | | {orientation=column,compression=low} + regress_rls_schema | account_row | table | | {orientation=row,compression=no} + regress_rls_schema | alice_public_1 | table | | {orientation=row,compression=no} + regress_rls_schema | category_col | table | | {orientation=column,compression=low} + regress_rls_schema | category_row | table | | {orientation=row,compression=no} + regress_rls_schema | document_col | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | document_row | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | par_col_t1 | table | | {orientation=column,compression=low,enable_rowsecurity=true} + regress_rls_schema | par_row_t1 | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | tt_rep | table | | {orientation=row,compression=no,enable_rowsecurity=true} (10 rows) \df - List of functions - Schema | Name | Result data type | Argument data types | Type | fencedmode | propackage ---------------------+------------+------------------+---------------------+--------+------------+------------ - regress_rls_schema | rls_fleak1 | boolean | text | normal | f | f - regress_rls_schema | rls_fleak2 | boolean | text | normal | f | f + List of functions + Schema | Name | Result data type | Argument data types | Type | fencedmode | propackage | prokind +--------------------+------------+------------------+---------------------+--------+------------+------------+--------- + regress_rls_schema | rls_fleak1 | boolean | text | normal | f | f | f + regress_rls_schema | rls_fleak2 | boolean | text | normal | f | f | f (2 rows) -- viewpoint from regress_rls_peter @@ -725,8 +726,10 @@ DELETE FROM document_row WHERE did = 100 RETURNING dauthor, did; -- only owner can change policies ALTER POLICY p01 ON document_row USING (true); --fail ERROR: must be owner of relation document_row +DETAIL: N/A DROP POLICY p01 ON document_col; --fail ERROR: must be owner of relation document_col +DETAIL: N/A -- check data from partition table SELECT * FROM par_row_t1 WHERE a > 7 ORDER BY 1, 2; id | a | b @@ -777,25 +780,25 @@ SELECT COUNT(*) FROM document_row_david; List of relations Schema | Name | Type | Owner | Storage --------------------+--------------------+-------+-------------------+-------------------------------------------------------------- - regress_rls_schema | account_col | table | regress_rls_alice | {orientation=column,compression=low} - regress_rls_schema | account_row | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | alice_public_2 | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | category_col | table | regress_rls_alice | {orientation=column,compression=low} - regress_rls_schema | category_row | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | document_col | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | document_row | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | account_col | table | | {orientation=column,compression=low} + regress_rls_schema | account_row | table | | {orientation=row,compression=no} + regress_rls_schema | alice_public_2 | table | | {orientation=row,compression=no} + regress_rls_schema | category_col | table | | {orientation=column,compression=low} + regress_rls_schema | category_row | table | | {orientation=row,compression=no} + regress_rls_schema | document_col | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | document_row | table | | {orientation=row,compression=no,enable_rowsecurity=true} regress_rls_schema | document_row_david | table | regress_rls_david | {orientation=row,compression=no} - regress_rls_schema | par_col_t1 | table | regress_rls_alice | {orientation=column,compression=low,enable_rowsecurity=true} - regress_rls_schema | par_row_t1 | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | tt_rep | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | par_col_t1 | table | | {orientation=column,compression=low,enable_rowsecurity=true} + regress_rls_schema | par_row_t1 | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | tt_rep | table | | {orientation=row,compression=no,enable_rowsecurity=true} (11 rows) \df - List of functions - Schema | Name | Result data type | Argument data types | Type | fencedmode | propackage ---------------------+------------+------------------+---------------------+--------+------------+------------ - regress_rls_schema | rls_fleak1 | boolean | text | normal | f | f - regress_rls_schema | rls_fleak2 | boolean | text | normal | f | f + List of functions + Schema | Name | Result data type | Argument data types | Type | fencedmode | propackage | prokind +--------------------+------------+------------------+---------------------+--------+------------+------------+--------- + regress_rls_schema | rls_fleak1 | boolean | text | normal | f | f | f + regress_rls_schema | rls_fleak2 | boolean | text | normal | f | f | f (2 rows) -- change to super user @@ -834,10 +837,13 @@ SELECT * FROM pg_rlspolicies ORDER BY tablename, policyname; regress_rls_schema | par_row_t1 | par_row_t1_rls2 | RESTRICTIVE | {regress_rls_group2} | ALL | (id < 30) pg_catalog | pg_attribute | pg_attribute_rls | PERMISSIVE | {public} | SELECT | has_table_privilege("current_user"(), attrelid, 'select'::text) pg_catalog | pg_class | pg_class_rls | PERMISSIVE | {public} | SELECT | has_table_privilege("current_user"(), oid, 'select'::text) + pg_catalog | pg_namespace | pg_namespace_rls | PERMISSIVE | {public} | SELECT | has_schema_privilege("current_user"(), oid, 'USAGE'::text) + pg_catalog | pg_partition | pg_partition_rls | PERMISSIVE | {public} | SELECT | has_table_privilege("current_user"(), parentid, 'select'::text) pg_catalog | pg_proc | pg_proc_rls | PERMISSIVE | {public} | SELECT | has_function_privilege("current_user"(), oid, 'execute'::text) + pg_catalog | pgxc_slice | pgxc_slice_rls | PERMISSIVE | {public} | SELECT | has_table_privilege("current_user"(), relid, 'select'::text) regress_rls_schema | tt_rep | tt_rep_rls1 | PERMISSIVE | {regress_rls_group1} | SELECT | ((name)::name = "current_user"()) regress_rls_schema | tt_rep | tt_rep_rls2 | PERMISSIVE | {regress_rls_group2} | SELECT | (id = 1) -(17 rows) +(20 rows) -- enable private object ALTER DATABASE regression DISABLE PRIVATE OBJECT; @@ -975,30 +981,30 @@ SELECT * FROM tt_rep; List of relations Schema | Name | Type | Owner | Storage --------------------+--------------------+-------+-------------------+--------------------------------------------------------------------------------- - regress_rls_schema | account_col | table | regress_rls_alice | {orientation=column,compression=low} - regress_rls_schema | account_row | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | alice_private | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | alice_public_1 | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | alice_public_2 | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | category_col | table | regress_rls_alice | {orientation=column,compression=low} - regress_rls_schema | category_row | table | regress_rls_alice | {orientation=row,compression=no} - regress_rls_schema | document_col | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | document_row | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | account_col | table | | {orientation=column,compression=low} + regress_rls_schema | account_row | table | | {orientation=row,compression=no} + regress_rls_schema | alice_private | table | | {orientation=row,compression=no} + regress_rls_schema | alice_public_1 | table | | {orientation=row,compression=no} + regress_rls_schema | alice_public_2 | table | | {orientation=row,compression=no} + regress_rls_schema | category_col | table | | {orientation=column,compression=low} + regress_rls_schema | category_row | table | | {orientation=row,compression=no} + regress_rls_schema | document_col | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | document_row | table | | {orientation=row,compression=no,enable_rowsecurity=true} regress_rls_schema | document_row_david | table | regress_rls_david | {orientation=row,compression=no} regress_rls_schema | inlist_t1 | table | regress_rls_david | {orientation=row,compression=no,enable_rowsecurity=true,force_rowsecurity=true} - regress_rls_schema | par_col_t1 | table | regress_rls_alice | {orientation=column,compression=low,enable_rowsecurity=true} - regress_rls_schema | par_row_t1 | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | tt_rep | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | par_col_t1 | table | | {orientation=column,compression=low,enable_rowsecurity=true} + regress_rls_schema | par_row_t1 | table | | {orientation=row,compression=no,enable_rowsecurity=true} + regress_rls_schema | tt_rep | table | | {orientation=row,compression=no,enable_rowsecurity=true} (14 rows) \df - List of functions - Schema | Name | Result data type | Argument data types | Type | fencedmode | propackage ---------------------+------------------------+------------------+----------------------------+--------+------------+------------ - regress_rls_schema | rls_auto_create_policy | integer | t_name text, p_num integer | normal | f | f - regress_rls_schema | rls_auto_drop_policy | integer | t_name text, p_num integer | normal | f | f - regress_rls_schema | rls_fleak1 | boolean | text | normal | f | f - regress_rls_schema | rls_fleak2 | boolean | text | normal | f | f + List of functions + Schema | Name | Result data type | Argument data types | Type | fencedmode | propackage | prokind +--------------------+------------------------+------------------+----------------------------+--------+------------+------------+--------- + regress_rls_schema | rls_auto_create_policy | integer | t_name text, p_num integer | normal | f | f | f + regress_rls_schema | rls_auto_drop_policy | integer | t_name text, p_num integer | normal | f | f | f + regress_rls_schema | rls_fleak1 | boolean | text | normal | f | f | f + regress_rls_schema | rls_fleak2 | boolean | text | normal | f | f | f (4 rows) -- viewpoint from regress_rls_alice again @@ -1018,8 +1024,8 @@ ALTER TABLE par_row_t1 FORCE ROW LEVEL SECURITY; regress_rls_schema | category_row | table | regress_rls_alice | {orientation=row,compression=no} regress_rls_schema | document_col | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} regress_rls_schema | document_row | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true} - regress_rls_schema | document_row_david | table | regress_rls_david | {orientation=row,compression=no} - regress_rls_schema | inlist_t1 | table | regress_rls_david | {orientation=row,compression=no,enable_rowsecurity=true,force_rowsecurity=true} + regress_rls_schema | document_row_david | table | | {orientation=row,compression=no} + regress_rls_schema | inlist_t1 | table | | {orientation=row,compression=no,enable_rowsecurity=true,force_rowsecurity=true} regress_rls_schema | par_col_t1 | table | regress_rls_alice | {orientation=column,compression=low,enable_rowsecurity=true} regress_rls_schema | par_row_t1 | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true,force_rowsecurity=true} regress_rls_schema | tt_rep | table | regress_rls_alice | {orientation=row,compression=no,enable_rowsecurity=true,force_rowsecurity=true} diff --git a/src/test/regress/expected/security_grant.out b/src/test/regress/expected/security_grant.out index 2367dd34a..b540f0818 100644 --- a/src/test/regress/expected/security_grant.out +++ b/src/test/regress/expected/security_grant.out @@ -7,27 +7,16 @@ return num1+num2; end / grant all on security_t1 to public; -ERROR: grant to public operation is forbidden in security mode grant all on security_v1 to public; -ERROR: grant to public operation is forbidden in security mode grant all (f1) on table security_t1 to public; -ERROR: grant to public operation is forbidden in security mode grant all on schema cstore to public; -ERROR: grant to public operation is forbidden in security mode grant all on tablespace pg_global to public; -ERROR: grant to public operation is forbidden in security mode grant all on function add_func(num1 int, num2 int) to public; -ERROR: grant to public operation is forbidden in security mode grant all on type bool to public; -ERROR: grant to public operation is forbidden in security mode grant all on language plpgsql to public; -ERROR: grant to public operation is forbidden in security mode grant all on security_t1 to public with grant option; -ERROR: WITH GRANT OPTION is not supported in security mode. -copy security_t1 to '/temp/copy_error'; -ERROR: operation copy with file is forbidden in security mode. -copy security_t1 from '/temp/copy_error'; -ERROR: operation copy with file is forbidden in security mode. +ERROR: invalid grant operation +DETAIL: Grant options can only be granted to roles. drop function add_func(num1 int, num2 int); drop view security_v1; drop table security_t1; diff --git a/src/test/regress/input/gin_getbitmap.source b/src/test/regress/input/gin_getbitmap.source index 8a55ef555..e5dd7d4c6 100644 --- a/src/test/regress/input/gin_getbitmap.source +++ b/src/test/regress/input/gin_getbitmap.source @@ -4,4 +4,4 @@ \! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "alter text search configuration tscp_utf8_003 add mapping for zh_words, en_word, multisymbol,numeric, alnum, grapsymbol with simple;"; \! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "create index gin_getbitmap_table_idx1 on gin_getbitmap_table using gin(to_tsvector('tscp_utf8_003',c_varchar));"; \! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "create index gin_getbitmap_table_idx2 on gin_getbitmap_table using gin(to_tsvector('tscp_utf8_003',c_text));"; -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "select count(*) from gin_getbitmap_table where to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','////') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','\$\$\$\$\$\$') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','#####') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','%%%%%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003','……&**%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') order by 1;" \ No newline at end of file +\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "select count(*) from gin_getbitmap_table where to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','////') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','\$\$\$\$\$\$') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','#####') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','%%%%%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003','……&**%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') order by 1;" diff --git a/src/test/regress/input/gin_select.source b/src/test/regress/input/gin_select.source index 04f88962e..52d6e15ee 100644 --- a/src/test/regress/input/gin_select.source +++ b/src/test/regress/input/gin_select.source @@ -4,14 +4,13 @@ CREATE DATABASE db_gin_utf8 TEMPLATE template0 encoding 'UTF8'; SET ENABLE_SEQSCAN=OFF; SET ENABLE_INDEXSCAN=OFF; SET ENABLE_BITMAPSCAN=ON; -SET ENABLE_FAST_QUERY_SHIPPING=OFF; --- import data -create table import_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text) distribute by hash (id); +create table import_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text); copy import_data from '@abs_srcdir@/data/gin_data_1000.txt'; --- import data then create index -create table gin_test_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text) distribute by hash (id); +create table gin_test_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text); insert into gin_test_data select 1, chepai, shenfenzheng, duanxin from import_data; --- 6 times insert into gin_test_data select * from gin_test_data; @@ -33,7 +32,7 @@ select count(*) from gin_test_data where to_tsvector('ngram', shenfenzheng) @@ t select count(*) from gin_test_data where to_tsvector('ngram', shenfenzheng) @@ to_tsquery('ngram', '325682195604186793'); --- gin data page split -create table gin_test_data_1(id int, shenfenzheng varchar(20)) distribute by hash (id); +create table gin_test_data_1(id int, shenfenzheng varchar(20)); insert into gin_test_data_1 select id, shenfenzheng from gin_test_data; --- 7 times insert into gin_test_data_1 select * from gin_test_data_1; diff --git a/src/test/regress/input/gs_guc_reload.source b/src/test/regress/input/gs_guc_reload.source index e98b5094f..2eb22efeb 100644 --- a/src/test/regress/input/gs_guc_reload.source +++ b/src/test/regress/input/gs_guc_reload.source @@ -1,9 +1,9 @@ -----gs_guc_reload(GUC) set default value of lockwait_timeout by gs_guc reload --set new value \! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "lockwait_timeout=1s" -\! sleep 10s +\! sleep 3s show lockwait_timeout; --no assign value \! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "lockwait_timeout" -\! sleep 10s +\! sleep 3s show lockwait_timeout; diff --git a/src/test/regress/input/hw_cstore_analyze.source b/src/test/regress/input/hw_cstore_analyze.source index 2c8b4a0da..281297088 100644 --- a/src/test/regress/input/hw_cstore_analyze.source +++ b/src/test/regress/input/hw_cstore_analyze.source @@ -18,8 +18,7 @@ CREATE TABLE lineitem_with_null , L_SHIPMODE CHAR(10) , L_COMMENT VARCHAR(44) ) -with (orientation = column) -distribute by hash(L_ORDERKEY); +with (orientation = column); COPY lineitem_with_null FROM '@abs_srcdir@/data/lineitem.data' with (format 'text', delimiter '|', null ''); analyze lineitem_with_null; analyze lineitem_with_null(L_PARTKEY); diff --git a/src/test/regress/input/hw_cstore_btree_index.source b/src/test/regress/input/hw_cstore_btree_index.source index 2ff77e142..05a038bf2 100644 --- a/src/test/regress/input/hw_cstore_btree_index.source +++ b/src/test/regress/input/hw_cstore_btree_index.source @@ -1,25 +1,25 @@ -create schema cstore_btree_index; -set current_schema = cstore_btree_index; --- --case 1: unsupported index test --- +DROP TABLE if exists cstore_insert_t1; +DROP TABLE if exists row_table; CREATE TABLE cstore_insert_t1(c1 int, c2 float, c3 text) WITH (orientation = column); COPY cstore_insert_t1 FROM '@abs_srcdir@/data/cstore_copy_t2.data' DELIMITER ','; -CREATE UNIQUE INDEX unsupport1_idx ON cstore_insert_t1 using btree(c1); -CREATE INDEX CONCURRENTLY unsupport2_idx ON cstore_insert_t1 using btree(c1); -CREATE INDEX unsupport3_idx ON cstore_insert_t1 using btree(lower(c2)); -CREATE INDEX unsupport4_idx ON cstore_insert_t1 using btree(c1) where c1 > 1; -CREATE INDEX unsupport5_idx ON cstore_insert_t1 using btree(c2 NULLS FIRST); +CREATE UNIQUE INDEX unsupport1_idx ON cstore_insert_t1(c1); +CREATE INDEX CONCURRENTLY unsupport2_idx ON cstore_insert_t1(c1); +CREATE INDEX unsupport3_idx ON cstore_insert_t1(lower(c2)); +CREATE INDEX unsupport4_idx ON cstore_insert_t1(c1) where c1 > 1; +CREATE INDEX unsupport5_idx ON cstore_insert_t1(c2 NULLS FIRST); CREATE INDEX unsupport6_idx ON cstore_insert_t1 USING hash (c1); CREATE INDEX unsupport7_idx ON cstore_insert_t1 USING gist (c1); CREATE INDEX unsupport9_idx ON cstore_insert_t1 USING spgist (c1); CREATE INDEX unsupport10_idx ON cstore_insert_t1 USING btree (c1); COPY cstore_insert_t1 FROM '@abs_srcdir@/data/cstore_copy_t2.data' DELIMITER ','; -DROP TABLE cstore_insert_t1; +DROP TABLE if exists cstore_insert_t1; CREATE TABLE row_table(c1 int, c2 float, c3 text); CREATE INDEX unsupport11_idx ON row_table USING psort (c1); -DROP TABLE row_table; +DROP TABLE if exists row_table; ----------- ---case 2: partition table create index test @@ -45,7 +45,7 @@ CREATE TABLE LINEITEM --, primary key (L_ORDERKEY, L_LINENUMBER) ) with (orientation = column) -distribute by hash(L_ORDERKEY) + PARTITION BY RANGE(L_SHIPDATE) ( PARTITION p1 VALUES LESS THAN('1993-01-01 00:00:00'), @@ -57,51 +57,43 @@ PARTITION BY RANGE(L_SHIPDATE) PARTITION p7 VALUES LESS THAN('2030-01-01 00:00:00') ); COPY LINEITEM FROM '@abs_srcdir@/data/lineitem_index.data' DELIMITER '|'; -create index idx1 on lineitem using btree(L_ORDERKEY) local; -create index idx2 on lineitem using btree(L_PARTKEY) local; -create index idx3 on lineitem using btree(L_LINENUMBER, L_SHIPDATE) local; -create index idx4 on lineitem using btree(L_RETURNFLAG) local; -create index idx5 on lineitem using btree(L_LINESTATUS, L_SHIPINSTRUCT) local; +create index idx1 on lineitem(L_ORDERKEY) local; +create index idx2 on lineitem(L_PARTKEY) local; +create index idx3 on lineitem(L_LINENUMBER, L_SHIPDATE) local; +create index idx4 on lineitem(L_RETURNFLAG) local; +create index idx5 on lineitem(L_LINESTATUS, L_SHIPINSTRUCT) local; COPY LINEITEM FROM '@abs_srcdir@/data/lineitem_index.data' DELIMITER '|'; set enable_bitmapscan=off; set enable_seqscan=off; select count(*) from lineitem where L_ORDERKEY > 100 and L_ORDERKEY < 200; truncate table lineitem; -drop index idx1; -drop index idx2; -drop index idx3; -drop index idx4; -drop index idx5; -drop table lineitem; +drop index if exists idx1; +drop index if exists idx2; +drop index if exists idx3; +drop index if exists idx4; +drop index if exists idx5; +drop table if exists lineitem; +---- +--case 3: check reserve column +---- +CREATE TABLE check_column(id int, tid int); +CREATE TABLE check_column(id int, tid_test int, ti int); +ALTER TABLE check_column ADD COLUMN tid int; +drop table if exists check_column; -------- ---- case 8: index scan with none partition hit -------- -CREATE TABLE partition_none ( - a1 character varying(1000), - a2 integer, - a3 character varying(1000), - a4 integer, - a5 character varying(1000), - a6 integer, - a7 character varying(1000), - a8 integer, - a9 character varying(1000), - a10 integer -) -WITH (orientation=column) -DISTRIBUTE BY HASH (a4) -PARTITION BY RANGE (a2) -( - PARTITION p1 VALUES LESS THAN (1), - PARTITION p50001 VALUES LESS THAN (50001), - PARTITION p100001 VALUES LESS THAN (100001), - PARTITION p150001 VALUES LESS THAN (150001), - PARTITION p200001 VALUES LESS THAN (200001), - PARTITION p250001 VALUES LESS THAN (250001)); -create index aii on partition_none using btree(a9) local; -SELECT a1, a9 FROM /*TaRgET*/ partition_none WHERE a5='ata l' AND 6793839=a2 AND a2=6159730 AND a9='da' ORDER BY a1, a9; -drop table partition_none; +----- +--- case 6: truncate and delete cstore relation with index +----- +create table IDEX_PARTITION_TABLE_001(COL_INT int) with(orientation=column); +CREATE INDEX STORAGE_IDEX_PARTITION_IDEX_001 ON IDEX_PARTITION_TABLE_001(COL_INT); +insert into IDEX_PARTITION_TABLE_001 values(1000); +truncate table IDEX_PARTITION_TABLE_001; +select * from IDEX_PARTITION_TABLE_001; + +insert into IDEX_PARTITION_TABLE_001 values(1000); +delete from IDEX_PARTITION_TABLE_001 where col_int=1000; +select * from IDEX_PARTITION_TABLE_001 where col_int=1000; + +drop table if exists IDEX_PARTITION_TABLE_001; -drop schema cstore_btree_index cascade; diff --git a/src/test/regress/input/hw_cstore_btree_index1.source b/src/test/regress/input/hw_cstore_btree_index1.source index b6a581f7a..743a6d8aa 100644 --- a/src/test/regress/input/hw_cstore_btree_index1.source +++ b/src/test/regress/input/hw_cstore_btree_index1.source @@ -23,7 +23,7 @@ create table row_index_tbl( ,num2 decimal ,serial1 int ,interval1 interval - ,interval2 tinterval) distribute by hash(id2); + ,interval2 tinterval); insert into row_index_tbl values(10,400,2000,40000,1,111111,1.1,'a','aa','bb','cc','dd','ff','1996-02-12','1984-2-6 01:00:30+8','02:05:36',30.12,0.03,2147483647,'2 day 13:34:56','["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]'); insert into row_index_tbl values(20,300,3000,10000,2,222222,2.2,'b','ee','cc','dd','aa','hh','1998-03-24','1986-2-6 03:00:30+8','04:36:25',20.15,0.06,-2147483647,'1 day 18:34:56','["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]'); @@ -51,43 +51,43 @@ create table cstore_index_tbl( ,num2 decimal ,serial1 int ,interval1 interval - ,interval2 tinterval)with(orientation=column) distribute by hash(id2); + ,interval2 tinterval)with(orientation=column); insert into cstore_index_tbl select * from row_index_tbl; select ctid from cstore_index_tbl order by 1; -create index idx_int1 on cstore_index_tbl using btree(id1); -create index idx_int2 on cstore_index_tbl using btree(id2); -create index idx_int4 on cstore_index_tbl using btree(id4); -create index idx_int8 on cstore_index_tbl using btree(id8); -create index idx_int on cstore_index_tbl using btree(int1); -create index idx_bigint on cstore_index_tbl using btree(bint); -create index idx_float on cstore_index_tbl using btree(flag); -create index idx_varchar on cstore_index_tbl using btree(name1); -create index idx_varchar2 on cstore_index_tbl using btree(name2); -create index idx_nvarchar2 on cstore_index_tbl using btree(name3); -create index idx_text on cstore_index_tbl using btree(name4); -create index idx_date on cstore_index_tbl using btree(time1); -create index idx_timetz on cstore_index_tbl using btree(time2); -create index idx_time on cstore_index_tbl using btree(time3); -create index idx_float8 on cstore_index_tbl using btree(num1); -create index idx_decimal on cstore_index_tbl using btree(num2); -create index idx_serial on cstore_index_tbl using btree(serial1); -create index idx_interval on cstore_index_tbl using btree(interval1); -create index idx_tinterval on cstore_index_tbl using btree(interval2); +create index idx_int1 on cstore_index_tbl(id1); +create index idx_int2 on cstore_index_tbl(id2); +create index idx_int4 on cstore_index_tbl(id4); +create index idx_int8 on cstore_index_tbl(id8); +create index idx_int on cstore_index_tbl(int1); +create index idx_bigint on cstore_index_tbl(bint); +create index idx_float on cstore_index_tbl(flag); +create index idx_varchar on cstore_index_tbl(name1); +create index idx_varchar2 on cstore_index_tbl(name2); +create index idx_nvarchar2 on cstore_index_tbl(name3); +create index idx_text on cstore_index_tbl(name4); +create index idx_date on cstore_index_tbl(time1); +create index idx_timetz on cstore_index_tbl(time2); +create index idx_time on cstore_index_tbl(time3); +create index idx_float8 on cstore_index_tbl(num1); +create index idx_decimal on cstore_index_tbl(num2); +create index idx_serial on cstore_index_tbl(serial1); +create index idx_interval on cstore_index_tbl(interval1); +create index idx_tinterval on cstore_index_tbl(interval2); -create index idx_id4_name1 on cstore_index_tbl using btree(id4,name1); -create index idx_id4_name2 on cstore_index_tbl using btree(id4,name2); -create index idx_id4_name3 on cstore_index_tbl using btree(id4,name3); -create index idx_id4_name4 on cstore_index_tbl using btree(id4,name4); -create index idx_bint_flag on cstore_index_tbl using btree(bint,flag); -create index idx_int1_time on cstore_index_tbl using btree(int1,time3); -create index idx_time1_name2 on cstore_index_tbl using btree(time1,name2); -create index idx_id4_time2 on cstore_index_tbl using btree(id4,time2); -create index idx_num1_time2 on cstore_index_tbl using btree(num1,time2); -create index idx_id4_num2 on cstore_index_tbl using btree(id4,num2); -create index idx_name1_name2 on cstore_index_tbl using btree(name1,name2); -create index idx_time1_interval1 on cstore_index_tbl using btree(time1,interval1); +create index idx_id4_name1 on cstore_index_tbl(id4,name1); +create index idx_id4_name2 on cstore_index_tbl(id4,name2); +create index idx_id4_name3 on cstore_index_tbl(id4,name3); +create index idx_id4_name4 on cstore_index_tbl(id4,name4); +create index idx_bint_flag on cstore_index_tbl(bint,flag); +create index idx_int1_time on cstore_index_tbl(int1,time3); +create index idx_time1_name2 on cstore_index_tbl(time1,name2); +create index idx_id4_time2 on cstore_index_tbl(id4,time2); +create index idx_num1_time2 on cstore_index_tbl(num1,time2); +create index idx_id4_num2 on cstore_index_tbl(id4,num2); +create index idx_name1_name2 on cstore_index_tbl(name1,name2); +create index idx_time1_interval1 on cstore_index_tbl(time1,interval1); set enable_seqscan=off; @@ -177,41 +177,54 @@ drop index idx_int2; drop table row_index_tbl; drop table cstore_index_tbl; ------ ---- case 6: truncate and delete cstore relation with index ------ -create table IDEX_PARTITION_TABLE_001(COL_INT int) with(orientation=column); -CREATE INDEX STORAGE_IDEX_PARTITION_IDEX_001 ON IDEX_PARTITION_TABLE_001 using btree(COL_INT); -insert into IDEX_PARTITION_TABLE_001 values(1000); -truncate table IDEX_PARTITION_TABLE_001; -select * from IDEX_PARTITION_TABLE_001; - -insert into IDEX_PARTITION_TABLE_001 values(1000); -delete from IDEX_PARTITION_TABLE_001 where col_int=1000; -select * from IDEX_PARTITION_TABLE_001 where col_int=1000; - -drop table IDEX_PARTITION_TABLE_001; ---- --- case 7: two indexes with the same column ---- -create table row_index_tbl(c1 int,c2 int,c3 int) distribute by hash(c1); +create table row_index_tbl(c1 int,c2 int,c3 int) ; insert into row_index_tbl values(0,1,2); insert into row_index_tbl values(3,4,5); insert into row_index_tbl values(6,7,8); insert into row_index_tbl values(9,10,11); -create table cstore_index_tbl(c1 int,c2 int,c3 int) with (orientation = column) distribute by hash(c1); +create table cstore_index_tbl(c1 int,c2 int,c3 int) with (orientation = column) ; insert into cstore_index_tbl select * from row_index_tbl; -create index idx_c2 on cstore_index_tbl using btree(c2); +create index idx_c2 on cstore_index_tbl(c2); explain (verbose on, costs off) SELECT c2 FROM cstore_index_tbl WHERE c2 > 2 and c2 < 9; SELECT c2 FROM cstore_index_tbl WHERE c2 > 2 and c2 < 9 order by c2; drop table row_index_tbl; drop table cstore_index_tbl; +------- +--- case 8: index scan with none partition hit +------- +CREATE TABLE partition_none ( + a1 character varying(1000), + a2 integer, + a3 character varying(1000), + a4 integer, + a5 character varying(1000), + a6 integer, + a7 character varying(1000), + a8 integer, + a9 character varying(1000), + a10 integer +) +WITH (orientation=column) +PARTITION BY RANGE (a2) +( + PARTITION p1 VALUES LESS THAN (1), + PARTITION p50001 VALUES LESS THAN (50001), + PARTITION p100001 VALUES LESS THAN (100001), + PARTITION p150001 VALUES LESS THAN (150001), + PARTITION p200001 VALUES LESS THAN (200001), + PARTITION p250001 VALUES LESS THAN (250001)); +create index aii on partition_none(a9) local; +SELECT a1, a9 FROM /*TaRgET*/ partition_none WHERE a5='ata l' AND 6793839=a2 AND a2=6159730 AND a9='da' ORDER BY a1, a9; +drop table partition_none; ---- --- case 9: index scan with partition number be zero @@ -232,80 +245,9 @@ PARTITION BY RANGE(c_date_1) PARTITION COMPRESS_TABLE_INTEVAL_1 VALUES LESS THAN('2012-8-23') ); -CREATE INDEX INDEX_COMPRESS_1 ON COMPRESS_TABLE_INDEX using btree(C_INT_2) LOCAL; -CREATE INDEX INDEX_COMPRESS_2 ON COMPRESS_TABLE_INDEX using btree(C_DATE_1) LOCAL; -CREATE INDEX INDEX_COMPRESS_3 ON COMPRESS_TABLE_INDEX using btree(C_INT_1) LOCAL; +CREATE INDEX INDEX_COMPRESS_1 ON COMPRESS_TABLE_INDEX(C_INT_2) LOCAL; +CREATE INDEX INDEX_COMPRESS_2 ON COMPRESS_TABLE_INDEX(C_DATE_1) LOCAL; +CREATE INDEX INDEX_COMPRESS_3 ON COMPRESS_TABLE_INDEX(C_INT_1) LOCAL; SELECT COUNT(*) FROM COMPRESS_TABLE_INDEX WHERE C_DATE_1>='2012-09-01' AND C_DATE_1<'2012-9-20'; drop table COMPRESS_TABLE_INDEX; - ----- ---- case 10:index scan with qual push down ----- -set datestyle to iso; -SET IntervalStyle to postgres; -set time zone PRC; -CREATE TABLE PARTITION_SELECT_PICT_TABLE( -C_CHAR_3 CHAR(102400), -C_VARCHAR_3 VARCHAR(1024), -C_INT INTEGER, -C_NUMERIC numeric(10,5), -C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) -DISTRIBUTE BY HASH(C_CHAR_3) -partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) -( - partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), - partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), - partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') -); - -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',111,111.1,'2000-01-01 01:01:01'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',222,222.2,'2000-02-02 02:02:02'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,333.3,'2000-03-03 03:03:03'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('DEFGHIJ','defghij',444,444.4,'2000-04-04 04:04:04'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK','efghijk',555,555.5,'2000-05-05 05:05:05'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',666,666.6,'2000-06-06 06:06:06'); - -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,111,111.1,'2000-01-01 01:01:01'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,null,null,null); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',null,111.1,'2000-01-01 01:01:01'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',null,null,'2000-02-02 02:02:02'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH',null,222,null,'2000-02-02 02:02:02'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,null,'2000-03-03 03:03:03'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK',null,null,555.5,'2000-05-05 05:05:05'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',null,null,null); - -insert into PARTITION_SELECT_PICT_TABLE VALUES('A'||generate_series(1,5),'a'||generate_series(1,5),generate_series(1,5),cast( generate_series(1,5)||'.111' as numeric(10,5)),cast('2000-01-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('B'||generate_series(101,103),'b'||generate_series(101,103),generate_series(101,103),cast(generate_series(101,103)||'.111' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('C'||generate_series(201,205),'c'||generate_series(201,205),generate_series(201,205),cast(generate_series(201,205)||'.111' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('D'||generate_series(301,303),'d'||generate_series(301,303),generate_series(301,303),cast(generate_series(301,303)||'.111' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('DE'||generate_series(401,405),'de'||generate_series(401,405),generate_series(401,405),cast(generate_series(401,405)||'.111' as numeric(10,5)),cast('2000-05-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('E'||generate_series(501,504),'e'||generate_series(501,504),generate_series(501,504),cast( generate_series(501,504)||'.222' as numeric(10,5)),cast('2000-01-'||generate_series(1,4)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('F'||generate_series(601,603),'f'||generate_series(601,603),generate_series(601,603),cast(generate_series(601,603)||'.222' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('G'||generate_series(701,705),'g'||generate_series(701,705),generate_series(701,705),cast(generate_series(701,705)||'.222' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('GH'||generate_series(801,803),'gh'||generate_series(801,803),generate_series(801,803),cast(generate_series(801,803)||'.222' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); - - -CREATE TABLE VECTOR_PARTITION_SELECT_PICT_TABLE( -C_CHAR_3 CHAR(102400), -C_VARCHAR_3 VARCHAR(1024), -C_INT INTEGER, -C_NUMERIC numeric(10,5), -C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) with (orientation = column) -DISTRIBUTE BY HASH(C_CHAR_3) -partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) -( - partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), - partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), - partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') -); - -insert into VECTOR_PARTITION_SELECT_PICT_TABLE select * from PARTITION_SELECT_PICT_TABLE; - -create index PARTITION_SELECT_PICT_INDEX_1 ON VECTOR_PARTITION_SELECT_PICT_TABLE using btree(C_CHAR_3,C_VARCHAR_3,C_INT,C_NUMERIC,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); -create index PARTITION_SELECT_PICT_INDEX_2 ON VECTOR_PARTITION_SELECT_PICT_TABLE using btree(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); -create index PARTITION_SELECT_PICT_INDEX_3 ON VECTOR_PARTITION_SELECT_PICT_TABLE using btree(C_CHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); - -SELECT trim(C_CHAR_3) , trim(C_VARCHAR_3) , C_INT , C_NUMERIC , C_TS_WITHOUT , lower(trim(C_CHAR_3)) , initcap(trim(C_VARCHAR_3)) , abs(C_INT) , abs(C_NUMERIC) , extract(year from C_TS_WITHOUT) FROM VECTOR_PARTITION_SELECT_PICT_TABLE partition(PARTITION_SELECT_PICT_1) where 'a' not like C_VARCHAR_3 and 1000 != C_INT and C_NUMERIC is not null and (C_TS_WITHOUT >= '2000-01-01 01:01:01' and C_TS_WITHOUT <= '2000-09-09 09:09:09') ORDER BY 1 , 2 , 3 , 4 , 5 ; -drop table PARTITION_SELECT_PICT_TABLE; -drop table VECTOR_PARTITION_SELECT_PICT_TABLE; \ No newline at end of file diff --git a/src/test/regress/input/hw_cstore_btree_index2.source b/src/test/regress/input/hw_cstore_btree_index2.source index 1a5e11809..c5ba0a69f 100644 --- a/src/test/regress/input/hw_cstore_btree_index2.source +++ b/src/test/regress/input/hw_cstore_btree_index2.source @@ -1,18 +1,80 @@ -create schema cstore_btree_index2; -set current_schema = cstore_btree_index2; ---- ---case 3: check reserve column +--- case 10:index scan with qual push down ---- -CREATE TABLE check_column(id int, tid int); -CREATE TABLE check_column(id int); -ALTER TABLE check_column ADD COLUMN tid int; +set datestyle to iso; +SET IntervalStyle to postgres; +set time zone PRC; +CREATE TABLE PARTITION_SELECT_PICT_TABLE( +C_CHAR_3 CHAR(102400), +C_VARCHAR_3 VARCHAR(1024), +C_INT INTEGER, +C_NUMERIC numeric(10,5), +C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) -CREATE TABLE row_tbl_for_gin_idx(c_id tsvector ,c_d_id tsvector) DISTRIBUTE BY REPLICATION; +partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) +( + partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), + partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), + partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') +); + +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',111,111.1,'2000-01-01 01:01:01'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',222,222.2,'2000-02-02 02:02:02'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,333.3,'2000-03-03 03:03:03'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('DEFGHIJ','defghij',444,444.4,'2000-04-04 04:04:04'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK','efghijk',555,555.5,'2000-05-05 05:05:05'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',666,666.6,'2000-06-06 06:06:06'); + +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,111,111.1,'2000-01-01 01:01:01'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,null,null,null); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',null,111.1,'2000-01-01 01:01:01'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',null,null,'2000-02-02 02:02:02'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH',null,222,null,'2000-02-02 02:02:02'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,null,'2000-03-03 03:03:03'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK',null,null,555.5,'2000-05-05 05:05:05'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',null,null,null); + +insert into PARTITION_SELECT_PICT_TABLE VALUES('A'||generate_series(1,5),'a'||generate_series(1,5),generate_series(1,5),cast( generate_series(1,5)||'.111' as numeric(10,5)),cast('2000-01-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('B'||generate_series(101,103),'b'||generate_series(101,103),generate_series(101,103),cast(generate_series(101,103)||'.111' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('C'||generate_series(201,205),'c'||generate_series(201,205),generate_series(201,205),cast(generate_series(201,205)||'.111' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('D'||generate_series(301,303),'d'||generate_series(301,303),generate_series(301,303),cast(generate_series(301,303)||'.111' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('DE'||generate_series(401,405),'de'||generate_series(401,405),generate_series(401,405),cast(generate_series(401,405)||'.111' as numeric(10,5)),cast('2000-05-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('E'||generate_series(501,504),'e'||generate_series(501,504),generate_series(501,504),cast( generate_series(501,504)||'.222' as numeric(10,5)),cast('2000-01-'||generate_series(1,4)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('F'||generate_series(601,603),'f'||generate_series(601,603),generate_series(601,603),cast(generate_series(601,603)||'.222' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('G'||generate_series(701,705),'g'||generate_series(701,705),generate_series(701,705),cast(generate_series(701,705)||'.222' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('GH'||generate_series(801,803),'gh'||generate_series(801,803),generate_series(801,803),cast(generate_series(801,803)||'.222' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); + + +CREATE TABLE VECTOR_PARTITION_SELECT_PICT_TABLE( +C_CHAR_3 CHAR(102400), +C_VARCHAR_3 VARCHAR(1024), +C_INT INTEGER, +C_NUMERIC numeric(10,5), +C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) with (orientation = column) + +partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) +( + partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), + partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), + partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') +); + +insert into VECTOR_PARTITION_SELECT_PICT_TABLE select * from PARTITION_SELECT_PICT_TABLE; + +create index PARTITION_SELECT_PICT_INDEX_1 ON VECTOR_PARTITION_SELECT_PICT_TABLE(C_CHAR_3,C_VARCHAR_3,C_INT,C_NUMERIC,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); +create index PARTITION_SELECT_PICT_INDEX_2 ON VECTOR_PARTITION_SELECT_PICT_TABLE(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); +create index PARTITION_SELECT_PICT_INDEX_3 ON VECTOR_PARTITION_SELECT_PICT_TABLE(C_CHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); + +SELECT trim(C_CHAR_3) , trim(C_VARCHAR_3) , C_INT , C_NUMERIC , C_TS_WITHOUT , lower(trim(C_CHAR_3)) , initcap(trim(C_VARCHAR_3)) , abs(C_INT) , abs(C_NUMERIC) , extract(year from C_TS_WITHOUT) FROM VECTOR_PARTITION_SELECT_PICT_TABLE partition(PARTITION_SELECT_PICT_1) where 'a' not like C_VARCHAR_3 and 1000 != C_INT and C_NUMERIC is not null and (C_TS_WITHOUT >= '2000-01-01 01:01:01' and C_TS_WITHOUT <= '2000-09-09 09:09:09') ORDER BY 1 , 2 , 3 , 4 , 5 ; +drop table PARTITION_SELECT_PICT_TABLE; +drop table VECTOR_PARTITION_SELECT_PICT_TABLE; + +CREATE TABLE row_tbl_for_gin_idx(c_id tsvector ,c_d_id tsvector) ; CREATE INDEX ginidx_for_rowtbl ON row_tbl_for_gin_idx USING GIN(c_id,c_d_id) WITH (FASTUPDATE = OFF); -- test storage parameters for index normal-relation CREATE TABLE heaptbl_idxstorage ( a int, b int , c int ) with ( orientation = column ); -CREATE INDEX idx00_heaptbl_idxstorage ON heaptbl_idxstorage using btree(b) with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); +CREATE INDEX idx00_heaptbl_idxstorage ON heaptbl_idxstorage(b) with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); SELECT relam, relkind, reloptions FROM pg_class WHERE relname = 'idx00_heaptbl_idxstorage'; SELECT reloptions FROM pg_class WHERE oid = (SELECT relcudescrelid FROM pg_class WHERE relname = 'idx00_heaptbl_idxstorage'); ALTER INDEX idx00_heaptbl_idxstorage SET (max_batchrow = 40000, partial_cluster_rows = 920000, deltarow_threshold = 4000 ); @@ -21,7 +83,7 @@ SELECT reloptions FROM pg_class WHERE oid = (SELECT relcudescrelid FROM pg_class -- test storage parameters for index partition-relation CREATE TABLE parttbl_idxstorage ( a int, b int , c int ) with ( orientation = column ) partition by range(b) (partition p1 values less than (10), partition p2 values less than (100)); -CREATE INDEX idx00_parttbl_idxstorage ON parttbl_idxstorage using btree(c) local with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); +CREATE INDEX idx00_parttbl_idxstorage ON parttbl_idxstorage(c) local with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); SELECT relam, relkind, reloptions FROM pg_class WHERE relname = 'idx00_parttbl_idxstorage'; SELECT reloptions FROM pg_class WHERE oid in ( SELECT relcudescrelid from pg_partition where parentid = (SELECT oid FROM pg_class WHERE relname = 'idx00_parttbl_idxstorage') ); @@ -41,15 +103,15 @@ INSERT INTO coltbl SELECT * FROM rowtbl; TRUNCATE TABLE rowtbl; INSERT INTO rowtbl VALUES ( 1, 5) , (1, 6); INSERT INTO coltbl SELECT * FROM rowtbl; -CREATE INDEX idx_coltbl ON coltbl using btree(b); -SELECT * FROM coltbl WHERE b < 6 order by 1, 2; +CREATE INDEX idx_coltbl ON coltbl(b); +SELECT * FROM coltbl WHERE b < 6 order by b; DROP TABLE coltbl; DROP TABLE rowtbl; -- index scan: constant target list create table test_index_const_targetlist (id int,info int,info1 int) with(orientation=column); -create index idx1_test_index_const_targetlist on test_index_const_targetlist using btree(info); -create index idx2_test_index_const_targetlist on test_index_const_targetlist using btree(info1); +create index idx1_test_index_const_targetlist on test_index_const_targetlist(info); +create index idx2_test_index_const_targetlist on test_index_const_targetlist(info1); insert into test_index_const_targetlist values(generate_series(1,10),generate_series(1,10), 1); update test_index_const_targetlist set info=info+1 where info>5; select 1 from test_index_const_targetlist where info1=1 ; @@ -77,7 +139,7 @@ create table psort_schema.psort_base_tab ( col_timetz time with time zone, col_interval interval, col_smalldatetine smalldatetime,partial cluster key(col_timestamp) -) with (orientation=column) distribute by hash(col_int) +) with (orientation=column) partition by range (col_int) ( partition vector_base_tab_000_1 values less than (10), @@ -140,7 +202,7 @@ create table psort_base_tab ( col_timetz time with time zone, col_interval interval, col_smalldatetine smalldatetime,partial cluster key(col_timestamp) -) with (orientation=column) distribute by hash(col_int) +) with (orientation=column) partition by range (col_int) ( partition vector_base_tab_000_1 values less than (10), @@ -183,15 +245,15 @@ partition vector_base_tab_000_37 values less than (3887), partition vector_base_tab_000_38 values less than (3987), partition vector_base_tab_000_39 values less than (maxvalue) ); -create index psort_base_tab_index_0001 on psort_schema.psort_base_tab using btree(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; -create index psort_base_tab_index_0001 on psort_base_tab using btree(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; +create index psort_base_tab_index_0001 on psort_schema.psort_base_tab(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; +create index psort_base_tab_index_0001 on psort_base_tab(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; drop table psort_schema.psort_base_tab; drop table psort_base_tab; ---- -- create index in tablespace ---- -create table psort_schema.cstore_col_part (id int, cu int, num int, num1 int) with (orientation = column) distribute by hash(id) +create table psort_schema.cstore_col_part (id int, cu int, num int, num1 int) with (orientation = column) partition by range (num1) ( partition p1 values less than (1000), @@ -201,15 +263,15 @@ partition by range (num1) partition p5 values less than (5000), partition p6 values less than (maxvalue) ); -create table psort_schema.cstore_row (id int, cu int, num int, num1 int) distribute by hash(id); +create table psort_schema.cstore_row (id int, cu int, num int, num1 int) ; insert into psort_schema.cstore_row values(1, 1, generate_series(1, 5000), generate_series(1, 5000)); insert into psort_schema.cstore_col_part select * from psort_schema.cstore_row; -create tablespace psort_ts location '@testtablespace@/psort_ts' maxsize '256k'; -create index on psort_schema.cstore_col_part using btree(num) local tablespace psort_ts; +create tablespace psort_ts location '@abs_srcdir@/testtablespace/psort_ts' maxsize '256k'; +create index on psort_schema.cstore_col_part(num) local tablespace psort_ts; drop tablespace psort_ts; -create tablespace psort_ts location '@testtablespace@/psort_ts'; +create tablespace psort_ts location '@abs_srcdir@/testtablespace/psort_ts'; start transaction; -create index on psort_schema.cstore_col_part using btree(num) local tablespace psort_ts; +create index on psort_schema.cstore_col_part(num) local tablespace psort_ts; rollback; drop tablespace psort_ts; drop table psort_schema.cstore_col_part; @@ -222,15 +284,15 @@ insert into psort_schema.cstore_row values(1, 3, generate_series(1, 5000), gener insert into psort_schema.cstore_row values(1, 4, generate_series(1, 5000), generate_series(1, 5000)); insert into psort_schema.cstore_row values(1, 5, generate_series(1, 5000), generate_series(1, 5000)); -create table psort_schema.cstore_col (id int, cu int, num int, num1 int) with (orientation = column) distribute by hash(id); +create table psort_schema.cstore_col (id int, cu int, num int, num1 int) with (orientation = column) ; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 1; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 2; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 3; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 4; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 5; -create index on psort_schema.cstore_col using btree(num); -create index on psort_schema.cstore_col using btree(num1); +create index on psort_schema.cstore_col(num); +create index on psort_schema.cstore_col(num1); analyze psort_schema.cstore_col; select count(xmin) from psort_schema.cstore_col where num = 100; @@ -240,4 +302,3 @@ drop table psort_schema.cstore_row; drop table psort_schema.cstore_col; DROP SCHEMA psort_schema CASCADE; -drop schema cstore_btree_index2 cascade; diff --git a/src/test/regress/input/hw_partition_merge2.source b/src/test/regress/input/hw_partition_merge2.source index 69be1bc23..4486ece6e 100644 --- a/src/test/regress/input/hw_partition_merge2.source +++ b/src/test/regress/input/hw_partition_merge2.source @@ -82,11 +82,11 @@ SET enable_indexscan = OFF; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; -- merged index check, indexcan SET enable_seqscan = OFF; @@ -94,11 +94,11 @@ SET enable_indexscan = ON; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; -- merged index check, indexonlycan SET enable_seqscan = OFF; @@ -106,11 +106,11 @@ SET enable_indexscan = OFF; SET enable_indexonlyscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; --4.2 merge 3 partitions into one alter table test_merge_index_test merge partitions @@ -122,11 +122,11 @@ SET enable_indexscan = OFF; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; -- merged index check, indexcan SET enable_seqscan = OFF; @@ -134,11 +134,11 @@ SET enable_indexscan = ON; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; -- merged index check, indexonlycan SET enable_seqscan = OFF; @@ -146,11 +146,11 @@ SET enable_indexscan = OFF; SET enable_indexonlyscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; --4.3 merge multiple partitions into one alter table test_merge_index_test merge partitions @@ -188,11 +188,11 @@ SET enable_indexscan = OFF; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; -- merged index check, indexcan SET enable_seqscan = OFF; @@ -200,11 +200,11 @@ SET enable_indexscan = ON; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; -- merged index check, indexonlycan SET enable_seqscan = OFF; @@ -212,11 +212,11 @@ SET enable_indexscan = OFF; SET enable_indexonlyscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; select * from test_merge_index_test order by c1; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; select * from test_merge_index_test order by c1, c2; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; select * from test_merge_index_test order by c1, c2, c3; --clean up @@ -247,3 +247,4 @@ alter table test_merge_VM merge partitions test_merge_VM_px, test_merge_VM_p3 in select * from test_merge_VM partition (test_merge_VM_p1); drop table test_merge_VM; + diff --git a/src/test/regress/input/inlist2join_cost_base.source b/src/test/regress/input/inlist2join_cost_base.source index c3ef2e477..571834e11 100644 --- a/src/test/regress/input/inlist2join_cost_base.source +++ b/src/test/regress/input/inlist2join_cost_base.source @@ -6,24 +6,24 @@ set qrw_inlist2join_optmode=rule_base; set qrw_inlist2join_optmode=-1; set qrw_inlist2join_optmode=cost_base; -create table t1(c1 int, c2 int, c3 int) distribute by hash(c1); +create table t1(c1 int, c2 int, c3 int); copy t1 from '@abs_srcdir@/data/inlist2join.data'; -create table t2(c1 int, c2 int, c3 int) distribute by hash(c1); +create table t2(c1 int, c2 int, c3 int); insert into t2 select * from t1; ANALYZE t1; ANALYZE t2; -- T_HashJoin T_Stream T_SubqueryScan -explain (costs off, nodes off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; +explain (costs off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; -- T_MergeJoin set enable_hashjoin =off; -explain (costs off, nodes off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; +explain (costs off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; -- T_MergeJoin T_Material set enable_mergejoin = off; -explain (costs off, nodes off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; +explain (costs off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; create index index1 on t1(c1); create index index2 on t2(c1); @@ -31,14 +31,13 @@ create index index2 on t2(c1); set enable_nestloop =on; set enable_hashjoin = on; set enable_bitmapscan = off; -explain (costs off, nodes off) select * from (select * from t1 where t1.c1 in (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793) union all select * from t2) as dt where dt.c1 in ( 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279) order by 1; +explain (costs off) select * from (select * from t1 where t1.c1 in (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793) union all select * from t2) as dt where dt.c1 in ( 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279) order by 1; -- T_MergeAppend -- partition table create table t1_p(c1 int, c2 int, c3 int) -distribute by hash(c1) PARTITION BY RANGE(c1) ( PARTITION P1 VALUES LESS THAN(20000), @@ -49,7 +48,6 @@ PARTITION P8 VALUES LESS THAN(MAXVALUE) ); create table t2_p(c1 int, c2 int, c3 int) -distribute by hash(c1) PARTITION BY RANGE(c1) ( PARTITION P1 VALUES LESS THAN(30000), @@ -64,12 +62,13 @@ ANALYZE t1_p; ANALYZE t2_p; -- T_PartIterator -explain (costs off, nodes off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2_p.c2 in (1,2,3,4,5,6,7,8,9,10,11); +explain (costs off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2_p.c2 in (1,2,3,4,5,6,7,8,9,10,11); set enable_nestloop =off; -explain (costs off, nodes off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2_p.c2 in (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279); +explain (costs off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2_p.c2 in (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279); set enable_nestloop =on; -- T_WindowAgg plan -explain (costs off, nodes off) select c1,c2,avg(c3) OVER (PARTITION BY c1) from t1 where t1.c1 in (1,2,3,4,5,6,7,8,9,10,11) and t1.c2 in (1,2); +explain (costs off) select c1,c2,avg(c3) OVER (PARTITION BY c1) from t1 where t1.c1 in (1,2,3,4,5,6,7,8,9,10,11) and t1.c2 in (1,2); drop schema inlist2join_cost_base cascade; + diff --git a/src/test/regress/input/vec_hashjoin1.source b/src/test/regress/input/vec_hashjoin1.source index fc2545827..7ded74fdf 100644 --- a/src/test/regress/input/vec_hashjoin1.source +++ b/src/test/regress/input/vec_hashjoin1.source @@ -76,7 +76,7 @@ CREATE TABLE vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_02( C_DP double precision, C_DATE DATE, C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE, - C_TS_WITH TIMESTAMP WITH TIME ZONE, PARTIAL CLUSTER KEY(C_INT))WITH (ORIENTATION=COLUMN) DISTRIBUTE BY HASH (C_INT); + C_TS_WITH TIMESTAMP WITH TIME ZONE, PARTIAL CLUSTER KEY(C_INT))WITH (ORIENTATION=COLUMN); CREATE TABLE vector_hashjoin_engine.ROW_HASHJOIN_TABLE_03( C_CHAR_1 CHAR(1), @@ -151,55 +151,55 @@ CREATE TABLE vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_03( c1 int ,c2 int ,c3 char(100) -)distribute by hash(c1); +); create table vector_hashjoin_engine.ROW_HASHJOIN_TABLE_06 ( c1 int ,c2 int ,c3 char(100) -)distribute by hash(c2); +); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_05 ( c1 int ,c2 int ,c3 char(100) -)with (orientation = column) distribute by hash(c1); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_06 ( c1 int ,c2 int ,c3 char(100) -)with (orientation = column) distribute by hash(c2); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_09 ( c1 int1 ,c2 int -)with (orientation = column) distribute by hash(c2); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_10 ( c1 int1 ,c2 int -)with (orientation = column) distribute by hash(c2); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_13 ( c1 int not null ,c2 bigint not null ,c3 char(6) not null -)with (orientation = column) distribute by hash(c1); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_14 ( c1 int not null ,c2 bigint not null ,c3 char(6) not null -)with (orientation = column) distribute by hash(c1); +)with (orientation = column); @@ -308,7 +308,7 @@ explain (verbose on, costs off) SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT >10 AND A.C_BIGINT>5 ORDER BY 1, 2; --SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT <10 AND A.C_BIGINT>5 ORDER BY 1, 2; -explain (verbose on, costs off, nodes off) SELECT A.C_INT,A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT and A.C_BIGINT > 1000 WHERE A.C_INT <4 ORDER BY 1, 2; +explain (verbose on, costs off) SELECT A.C_INT,A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT and A.C_BIGINT > 1000 WHERE A.C_INT <4 ORDER BY 1, 2; SELECT A.C_INT,A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT and A.C_BIGINT > 1000 WHERE A.C_INT <4 ORDER BY 1, 2; SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT AND A.C_BIGINT<2 order by 1,2; @@ -318,10 +318,10 @@ SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HA ---- --- case 3: HashJoin Anti Join ---- -explain (verbose on, costs off, nodes off) SELECT B.C_INT , A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT AND A.C_BIGINT<2 where B.C_INT is NULL order by 1,2; +explain (verbose on, costs off) SELECT B.C_INT , A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT AND A.C_BIGINT<2 where B.C_INT is NULL order by 1,2; SELECT B.C_INT , A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT AND A.C_BIGINT<2 where B.C_INT is NULL order by 1,2; -explain (verbose on, costs off, nodes off) SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT where B.C_INT is NULL order by 1,2; +explain (verbose on, costs off) SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT where B.C_INT is NULL order by 1,2; SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT where B.C_INT is NULL order by 1,2; ---- diff --git a/src/test/regress/output/create_basetype.source b/src/test/regress/output/create_basetype.source index 867499dbe..37c321b40 100644 --- a/src/test/regress/output/create_basetype.source +++ b/src/test/regress/output/create_basetype.source @@ -1,22 +1,22 @@ create type complex; CREATE FUNCTION complex_in(cstring) RETURNS complex - AS '@libdir@/regress@DLSUFFIX@','complex_in' + AS '/usr3/data1/jiangyan/openGauss-server/src/test/regress/regress.so','complex_in' LANGUAGE C IMMUTABLE STRICT not fenced; NOTICE: return type complex is only a shell CREATE FUNCTION complex_out(complex) RETURNS cstring - AS '@libdir@/regress@DLSUFFIX@','complex_out' + AS '/usr3/data1/jiangyan/openGauss-server/src/test/regress/regress.so','complex_out' LANGUAGE C IMMUTABLE STRICT not fenced; NOTICE: argument type complex is only a shell CREATE FUNCTION complex_recv(internal) RETURNS complex - AS '@libdir@/regress@DLSUFFIX@','complex_recv' + AS '/usr3/data1/jiangyan/openGauss-server/src/test/regress/regress.so','complex_recv' LANGUAGE C IMMUTABLE STRICT not fenced; NOTICE: return type complex is only a shell CREATE FUNCTION complex_send(complex) RETURNS bytea - AS '@libdir@/regress@DLSUFFIX@','complex_send' + AS '/usr3/data1/jiangyan/openGauss-server/src/test/regress/regress.so','complex_send' LANGUAGE C IMMUTABLE STRICT not fenced; NOTICE: argument type complex is only a shell CREATE TYPE complex ( @@ -140,6 +140,11 @@ CREATE TYPE name ( CREATE TYPE name +CREATE TYPE name AS ENUM + ( [ 'lable' [, ... ] ] ) + +CREATE TYPE name AS TABLE OF data_type + \h alter type Command: ALTER TYPE Description: change the definition of a type diff --git a/src/test/regress/output/data_source.source b/src/test/regress/output/data_source.source index 65b485458..64ebde3c8 100644 --- a/src/test/regress/output/data_source.source +++ b/src/test/regress/output/data_source.source @@ -21,7 +21,8 @@ CREATE DATA SOURCE llt_mppdb_8 TYPE 'MPPDB' VERSION NULL OPTIONS (dsn 'mppdb', e CREATE DATA SOURCE llt_mppdb_9 OPTIONS (username '', dsn 'mppdb'); \! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} rm -f {}/bin/datasource.key.cipher \! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} rm -f {}/bin/datasource.key.rand -\! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} @abs_bindir@/gs_guc generate -S 123456@pwd -D {}/bin -o datasource > /dev/null 2>&1 +\! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc generate -S 123456@pwd -D {}/bin -o datasource +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -S ******** -D /data1/jiangyan/openGauss-server//dest/bin/..//bin -o datasource generate ]. gs_guc generate -S *** CREATE DATA SOURCE llt_mppdb_10 TYPE 'MPPDB' VERSION 'V1R7C10' OPTIONS (dsn 'mppdb', password 'pwd@123456789'); CREATE DATA SOURCE llt_mppdb_11 TYPE 'MPPDB' VERSION 'V1R7C10' OPTIONS (dsn 'mppdb', password 'pwd'); @@ -95,7 +96,7 @@ CREATE DATA SOURCE llt_tst_ds_1 options (dsn 'encryptOpt'); CREATE DATA SOURCE llt_tst_ds_2 options (encoding 'encryptOpt123'); CREATE DATA SOURCE llt_tst_ds_3 options (dsn 'tst', username 'encryptOpt12345678901234567', password 'encryptOpt12345671234567890'); NOTICE: Using probably encrypted option (prefix='encryptOpt') directly and it is not recommended. -HINT: The DATA SOURCE object can't be used if the option is not encrypted correctly. +HINT: The datasource object can't be used if the option is not encrypted correctly. SELECT srcoptions FROM pg_extension_data_source where srcname='llt_tst_ds_1'; srcoptions ------------------ @@ -255,9 +256,10 @@ SELECT * FROM PG_EXTENSION_DATA_SOURCE WHERE SRCNAME='llt_mppdb_31'; \! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} rm -f {}/bin/datasource.key.cipher \! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} rm -f {}/bin/datasource.key.rand ALTER DATA SOURCE llt_mppdb_31 TYPE 'MPPDB3' VERSION 'V1R7C20' OPTIONS (DROP encoding, username '123user', SET password '123456@pwd'); ---?.* ---?.* -\! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} @abs_bindir@/gs_guc generate -S 123456@pwd -D {}/bin -o datasource > /dev/null 2>&1 +ERROR: No key file datasource.key.cipher +HINT: Please create datasource.key.cipher file with gs_guc and gs_ssh, such as :gs_ssh -c "gs_guc generate -S XXX -D $GAUSSHOME/bin -o datasource" +\! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc generate -S 123456@pwd -D {}/bin -o datasource +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -S ******** -D /data1/jiangyan/openGauss-server//dest/bin/..//bin -o datasource generate ]. gs_guc generate -S *** SELECT PG_SLEEP(1); pg_sleep @@ -269,9 +271,9 @@ ALTER DATA SOURCE llt_mppdb_31 TYPE 'MPPDB3' VERSION 'V1R7C20' OPTIONS (DROP enc \! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} rm -f {}/bin/datasource.key.cipher \! echo $GAUSSHOME | sed 's/^.*tmp_check\/install\///g' | xargs -I{} rm -f {}/bin/datasource.key.rand SELECT * FROM PG_EXTENSION_DATA_SOURCE WHERE SRCNAME='llt_mppdb_31'; ---?.* ---?.* ---? llt_mppdb_31 | 10 | MPPDB3 | V1R7C20 | | {dsn=mppdb2,password=.*,username=.*} + srcname | srcowner | srctype | srcversion | srcacl | srcoptions +--------------+----------+---------+------------+--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + llt_mppdb_31 | 10 | MPPDB3 | V1R7C20 | | {dsn=mppdb2,password=encryptOptvj5E4r/A+1gzoFLm+HHetKWyCPWQB3uD9EyBSq7Yun6n7ih1Tnyk+dbBKJtWNcoT,username=encryptOptYEkl7iYwIlMreLTJV3QKXd+nCGXA9GxKEr5RywDEoIWYsZhvDZH1WkEVWbyxRpzA} (1 row) -- duplicated options @@ -298,7 +300,7 @@ ALTER DATA SOURCE llt_mppdb_31 RENAME TO llt_mppdb_31_new; SELECT srcname, srcowner FROM PG_EXTENSION_DATA_SOURCE WHERE SRCNAME='llt_mppdb_31_new'; srcname | srcowner ------------------+---------- ---? llt_mppdb_31_new |.* + llt_mppdb_31_new | 10 (1 row) -- alter owner @@ -311,7 +313,7 @@ ALTER DATA SOURCE llt_mppdb_31_new OWNER TO PLOKEN1; SELECT srcname, srcowner FROM PG_EXTENSION_DATA_SOURCE WHERE SRCNAME='llt_mppdb_31_new'; srcname | srcowner ------------------+---------- ---? llt_mppdb_31_new |.* + llt_mppdb_31_new | 16429 (1 row) DROP DATA SOURCE IF EXISTS llt_mppdb_31_new CASCADE; @@ -326,34 +328,35 @@ CREATE USER PLOKEN3 IDENTIFIED BY 'Gs@654321'; -- grant invalid privileges GRANT SELECT ON DATA SOURCE llt_mppdb_41 TO PLOKEN2; ERROR: invalid privilege type SELECT for data source +DETAIL: N/A -- grant valid privileges, here usage == all GRANT USAGE ON DATA SOURCE llt_mppdb_41 TO PLOKEN2; GRANT ALL PRIVILEGES ON DATA SOURCE llt_mppdb_42 TO PLOKEN2; SELECT srcname, srcacl FROM PG_EXTENSION_DATA_SOURCE WHERE srcname='llt_mppdb_41'; ---?.* ---?.* - llt_mppdb_41 | {@login_user@=U/@login_user@,ploken2=U/@login_user@} + srcname | srcacl +--------------+------------------------------------------ + llt_mppdb_41 | {jiangyan=U/jiangyan,ploken2=U/jiangyan} (1 row) SELECT srcname, srcacl FROM PG_EXTENSION_DATA_SOURCE WHERE srcname='llt_mppdb_42'; ---?.* ---?.* - llt_mppdb_42 | {@login_user@=U/@login_user@,ploken2=U/@login_user@} + srcname | srcacl +--------------+------------------------------------------ + llt_mppdb_42 | {jiangyan=U/jiangyan,ploken2=U/jiangyan} (1 row) -- revoke privileges REVOKE USAGE ON DATA SOURCE llt_mppdb_41 FROM PLOKEN2; REVOKE ALL ON DATA SOURCE llt_mppdb_42 FROM PLOKEN2; SELECT srcname, srcacl FROM PG_EXTENSION_DATA_SOURCE WHERE srcname='llt_mppdb_41'; ---?.* ---?.* - llt_mppdb_41 | {@login_user@=U/@login_user@} + srcname | srcacl +--------------+----------------------- + llt_mppdb_41 | {jiangyan=U/jiangyan} (1 row) SELECT srcname, srcacl FROM PG_EXTENSION_DATA_SOURCE WHERE srcname='llt_mppdb_42'; ---?.* ---?.* - llt_mppdb_42 | {@login_user@=U/@login_user@} + srcname | srcacl +--------------+----------------------- + llt_mppdb_42 | {jiangyan=U/jiangyan} (1 row) -- change owner @@ -363,18 +366,18 @@ ALTER DATA SOURCE llt_mppdb_42 OWNER TO PLOKEN3; GRANT ALL ON DATA SOURCE llt_mppdb_42 TO PLOKEN3; GRANT ALL ON DATA SOURCE llt_mppdb_42 TO PLOKEN2; SELECT srcname, srcacl FROM PG_EXTENSION_DATA_SOURCE WHERE srcname='llt_mppdb_42'; ---?.* ---?.* - llt_mppdb_42 | {@login_user@=U/@login_user@,ploken3=U/ploken3,ploken2=U/ploken3} + srcname | srcacl +--------------+----------------------------------------------------------- + llt_mppdb_42 | {jiangyan=U/jiangyan,ploken3=U/ploken3,ploken2=U/ploken3} (1 row) -- revoke usage (test all == usage) REVOKE USAGE ON DATA SOURCE llt_mppdb_42 FROM PLOKEN3; REVOKE USAGE ON DATA SOURCE llt_mppdb_42 FROM PLOKEN2; SELECT srcname, srcacl FROM PG_EXTENSION_DATA_SOURCE WHERE srcname='llt_mppdb_42'; ---?.* ---?.* - llt_mppdb_42 | {@login_user@=U/@login_user@} + srcname | srcacl +--------------+----------------------- + llt_mppdb_42 | {jiangyan=U/jiangyan} (1 row) DROP DATA SOURCE llt_mppdb_41; @@ -390,11 +393,11 @@ create data source mpp_llt_01 options (dsn 'mpp_llt_01'); create data source mpp_llt_01; ERROR: data source "mpp_llt_01" already exists grant usage on data source mpp_llt_01 to ds_user_llt_01; -\! @abs_bindir@/gsql -d postgres -p @portstring@ -U ds_user_llt_01 -W Gs@123456 -c "grant usage on data source mpp_llt_01 to ds_user_llt_02;" -WARNING: no privileges were granted for "mpp_llt_01" -GRANT -\! @abs_bindir@/gsql -d postgres -p @portstring@ -U ds_user_llt_01 -W Gs@123456 -c "alter data source mpp_llt_01 version '11.1';" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -d postgres -p 25632 -U ds_user_llt_01 -W Gs@123456 -c "grant usage on data source mpp_llt_01 to ds_user_llt_02;" +ERROR: no privileges were granted for "mpp_llt_01" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -d postgres -p 25632 -U ds_user_llt_01 -W Gs@123456 -c "alter data source mpp_llt_01 version '11.1';" ERROR: must be owner of data source mpp_llt_01 +DETAIL: N/A drop data source mpp_llt_01; drop user ds_user_llt_01; drop user ds_user_llt_02; @@ -404,70 +407,50 @@ drop user ds_user_llt_02; create data source myself options (dsn 'myself'); create table ds_s2_tbl_001 (c1 int); explain (costs off) select * from exec_on_extension('myself', 'select * from a') as (c1 int); - QUERY PLAN ------------------------------------------- - Streaming (type: GATHER) ---? Node/s: datanode.* - -> Function Scan on exec_on_extension -(3 rows) + QUERY PLAN +------------------------------------ + Function Scan on exec_on_extension +(1 row) explain (costs off) select * from exec_hadoop_sql('myself', 'select * from a', '') as (c1 int); - QUERY PLAN ----------------------------------------- - Streaming (type: GATHER) ---? Node/s: datanode.* - -> Function Scan on exec_hadoop_sql -(3 rows) + QUERY PLAN +---------------------------------- + Function Scan on exec_hadoop_sql +(1 row) explain (costs off) insert into ds_s2_tbl_001 select * from exec_on_extension('myself', 'select * from a') as (c1 int); - QUERY PLAN ------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Insert on ds_s2_tbl_001 - -> Streaming(type: REDISTRIBUTE) ---? Spawn on: datanode.* - -> Function Scan on exec_on_extension -(6 rows) + QUERY PLAN +------------------------------------------ + Insert on ds_s2_tbl_001 + -> Function Scan on exec_on_extension +(2 rows) explain (costs off) insert into ds_s2_tbl_001 select * from exec_hadoop_sql('myself', 'select * from a', '') as (c1 int); - QUERY PLAN ----------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Insert on ds_s2_tbl_001 - -> Streaming(type: REDISTRIBUTE) ---? Spawn on: datanode.* - -> Function Scan on exec_hadoop_sql -(6 rows) + QUERY PLAN +---------------------------------------- + Insert on ds_s2_tbl_001 + -> Function Scan on exec_hadoop_sql +(2 rows) explain (costs off) select * from (select * from exec_on_extension('myself', 'select * from a') as (c1 int)) a inner join ds_s2_tbl_001 b on a.c1=b.c1; - QUERY PLAN ------------------------------------------------------ - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (exec_on_extension.c1 = b.c1) + QUERY PLAN +------------------------------------------------ + Hash Join + Hash Cond: (b.c1 = exec_on_extension.c1) + -> Seq Scan on ds_s2_tbl_001 b + -> Hash -> Function Scan on exec_on_extension - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on ds_s2_tbl_001 b -(9 rows) +(5 rows) explain (costs off) select * from (select * from exec_hadoop_sql('myself', 'select * from a', '') as (c1 int)) a inner join ds_s2_tbl_001 b on a.c1=b.c1; - QUERY PLAN ------------------------------------------------------ - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (exec_hadoop_sql.c1 = b.c1) + QUERY PLAN +---------------------------------------------- + Hash Join + Hash Cond: (b.c1 = exec_hadoop_sql.c1) + -> Seq Scan on ds_s2_tbl_001 b + -> Hash -> Function Scan on exec_hadoop_sql - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Seq Scan on ds_s2_tbl_001 b -(9 rows) +(5 rows) explain (costs off) select * from ds_s2_tbl_001, @@ -476,28 +459,20 @@ where ds_s2_tbl_001.c1 = b.c1 and b.c1 in (select * from exec_on_extension('myself', 'select * from a') as (c1 int)); - QUERY PLAN ------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (exec_on_extension.c1 = ds_s2_tbl_001.c1) - -> Function Scan on exec_on_extension - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (ds_s2_tbl_001.c1 = exec_on_extension.c1) - -> Seq Scan on ds_s2_tbl_001 - -> Hash - -> HashAggregate - Group By Key: exec_on_extension.c1 - -> Streaming(type: REDISTRIBUTE) ---? Spawn on: datanode.* - -> HashAggregate - Group By Key: exec_on_extension.c1 - -> Function Scan on exec_on_extension -(19 rows) + QUERY PLAN +------------------------------------------------------------------------ + Hash Join + Hash Cond: (ds_s2_tbl_001.c1 = exec_on_extension.c1) + -> Seq Scan on ds_s2_tbl_001 + -> Hash + -> Hash Join + Hash Cond: (exec_on_extension.c1 = exec_on_extension.c1) + -> Function Scan on exec_on_extension + -> Hash + -> HashAggregate + Group By Key: exec_on_extension.c1 + -> Function Scan on exec_on_extension +(11 rows) explain (costs off) select * from ds_s2_tbl_001, @@ -506,28 +481,20 @@ where ds_s2_tbl_001.c1 = b.c1 and b.c1 in (select * from exec_hadoop_sql('myself', 'select * from a', '') as (c1 int)); - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (exec_hadoop_sql.c1 = ds_s2_tbl_001.c1) - -> Function Scan on exec_hadoop_sql - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (ds_s2_tbl_001.c1 = exec_hadoop_sql.c1) - -> Seq Scan on ds_s2_tbl_001 - -> Hash - -> HashAggregate - Group By Key: exec_hadoop_sql.c1 - -> Streaming(type: REDISTRIBUTE) ---? Spawn on: datanode.* - -> HashAggregate - Group By Key: exec_hadoop_sql.c1 - -> Function Scan on exec_hadoop_sql -(19 rows) + QUERY PLAN +-------------------------------------------------------------------- + Hash Join + Hash Cond: (ds_s2_tbl_001.c1 = exec_hadoop_sql.c1) + -> Seq Scan on ds_s2_tbl_001 + -> Hash + -> Hash Join + Hash Cond: (exec_hadoop_sql.c1 = exec_hadoop_sql.c1) + -> Function Scan on exec_hadoop_sql + -> Hash + -> HashAggregate + Group By Key: exec_hadoop_sql.c1 + -> Function Scan on exec_hadoop_sql +(11 rows) explain (costs off) select * from ds_s2_tbl_001, @@ -536,28 +503,20 @@ where ds_s2_tbl_001.c1 = b.c1 and b.c1 in (select * from exec_hadoop_sql('myself', 'select * from a', '') as (c1 int)); - QUERY PLAN ----------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (exec_on_extension.c1 = ds_s2_tbl_001.c1) - -> Function Scan on exec_on_extension - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (ds_s2_tbl_001.c1 = exec_hadoop_sql.c1) - -> Seq Scan on ds_s2_tbl_001 - -> Hash - -> HashAggregate - Group By Key: exec_hadoop_sql.c1 - -> Streaming(type: REDISTRIBUTE) ---? Spawn on: datanode.* - -> HashAggregate - Group By Key: exec_hadoop_sql.c1 - -> Function Scan on exec_hadoop_sql -(19 rows) + QUERY PLAN +---------------------------------------------------------------------- + Hash Join + Hash Cond: (ds_s2_tbl_001.c1 = exec_on_extension.c1) + -> Seq Scan on ds_s2_tbl_001 + -> Hash + -> Hash Join + Hash Cond: (exec_on_extension.c1 = exec_hadoop_sql.c1) + -> Function Scan on exec_on_extension + -> Hash + -> HashAggregate + Group By Key: exec_hadoop_sql.c1 + -> Function Scan on exec_hadoop_sql +(11 rows) explain (costs off) select * from ds_s2_tbl_001, @@ -566,28 +525,20 @@ where ds_s2_tbl_001.c1 = b.c1 and b.c1 in (select * from exec_on_extension('myself', 'select * from a') as (c1 int)); - QUERY PLAN ------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Node/s: All datanodes - -> Hash Join - Hash Cond: (exec_hadoop_sql.c1 = ds_s2_tbl_001.c1) - -> Function Scan on exec_hadoop_sql - -> Hash - -> Streaming(type: BROADCAST) - Spawn on: All datanodes - -> Hash Join - Hash Cond: (ds_s2_tbl_001.c1 = exec_on_extension.c1) - -> Seq Scan on ds_s2_tbl_001 - -> Hash - -> HashAggregate - Group By Key: exec_on_extension.c1 - -> Streaming(type: REDISTRIBUTE) ---? Spawn on: datanode.* - -> HashAggregate - Group By Key: exec_on_extension.c1 - -> Function Scan on exec_on_extension -(19 rows) + QUERY PLAN +---------------------------------------------------------------------- + Hash Join + Hash Cond: (ds_s2_tbl_001.c1 = exec_hadoop_sql.c1) + -> Seq Scan on ds_s2_tbl_001 + -> Hash + -> Hash Join + Hash Cond: (exec_hadoop_sql.c1 = exec_on_extension.c1) + -> Function Scan on exec_hadoop_sql + -> Hash + -> HashAggregate + Group By Key: exec_on_extension.c1 + -> Function Scan on exec_on_extension +(11 rows) drop table ds_s2_tbl_001; diff --git a/src/test/regress/output/dw_switch.source b/src/test/regress/output/dw_switch.source index 533f3da84..6c8be6103 100644 --- a/src/test/regress/output/dw_switch.source +++ b/src/test/regress/output/dw_switch.source @@ -1,24 +1,24 @@ -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_double_write=off" -The gs_guc run with the following arguments: [@abs_srcdir@/tmp_check/install//home/liyifeng/gaussMaster/gauss_app1/bin/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c enable_double_write=off set ]. -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: enable_double_write=off: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "enable_double_write=off" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c enable_double_write=off set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: enable_double_write=off: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/datanode1 > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/datanode1 > /dev/null +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_ctl stop -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1 > /dev/null +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_ctl start -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1 > /dev/null \! sleep 5 -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/datanode1 > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/datanode1 > /dev/null +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_ctl stop -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1 > /dev/null +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_ctl start -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1 > /dev/null \! sleep 5 -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_double_write=on" -The gs_guc run with the following arguments: [@abs_srcdir@/tmp_check/install//home/liyifeng/gaussMaster/gauss_app1/bin/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c enable_double_write=on set ]. -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: enable_double_write=on: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "enable_double_write=on" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c enable_double_write=on set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: enable_double_write=on: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/datanode1 > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/datanode1 > /dev/null +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_ctl stop -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1 > /dev/null +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_ctl start -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1 > /dev/null diff --git a/src/test/regress/output/gin_getbitmap.source b/src/test/regress/output/gin_getbitmap.source index a1f3f90e2..84e480818 100644 --- a/src/test/regress/output/gin_getbitmap.source +++ b/src/test/regress/output/gin_getbitmap.source @@ -1,17 +1,17 @@ -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "create table gin_getbitmap_table (c_int int,c_bigint bigint,c_varchar varchar,c_text text)with(orientation=row);"; +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "create table gin_getbitmap_table (c_int int,c_bigint bigint,c_varchar varchar,c_text text)with(orientation=row);"; CREATE TABLE -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "\copy gin_getbitmap_table from '@abs_srcdir@/data/gin_@.txt' delimiter ',';"; -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "create text search configuration tscp_utf8_003(parser=pound) with(split_flag='@');"; +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "\copy gin_getbitmap_table from '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/gin_@.txt' delimiter ',';"; +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "create text search configuration tscp_utf8_003(parser=pound) with(split_flag='@');"; CREATE TEXT SEARCH CONFIGURATION -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "alter text search configuration tscp_utf8_003 add mapping for zh_words, en_word, multisymbol,numeric, alnum, grapsymbol with simple;"; +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "alter text search configuration tscp_utf8_003 add mapping for zh_words, en_word, multisymbol,numeric, alnum, grapsymbol with simple;"; ALTER TEXT SEARCH CONFIGURATION -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "create index gin_getbitmap_table_idx1 on gin_getbitmap_table using gin(to_tsvector('tscp_utf8_003',c_varchar));"; +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "create index gin_getbitmap_table_idx1 on gin_getbitmap_table using gin(to_tsvector('tscp_utf8_003',c_varchar));"; CREATE INDEX -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "create index gin_getbitmap_table_idx2 on gin_getbitmap_table using gin(to_tsvector('tscp_utf8_003',c_text));"; +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "create index gin_getbitmap_table_idx2 on gin_getbitmap_table using gin(to_tsvector('tscp_utf8_003',c_text));"; CREATE INDEX -\! @abs_bindir@/gsql -dpostgres -p @portstring@ -c "select count(*) from gin_getbitmap_table where to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','////') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','\$\$\$\$\$\$') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','#####') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','%%%%%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003','……&**%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') order by 1;" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gsql -dpostgres -p 25632 -c "select count(*) from gin_getbitmap_table where to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','////') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','\$\$\$\$\$\$') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','#####') and to_tsvector('tscp_utf8_003',c_text) @@ to_tsquery('tscp_utf8_003','%%%%%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003','……&**%') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') and to_tsvector('tscp_utf8_003',c_text) @@ plainto_tsquery('tscp_utf8_003',' ') order by 1;" count ------- - 575 + 575 (1 row) diff --git a/src/test/regress/output/gin_select.source b/src/test/regress/output/gin_select.source index 865bed17b..466436872 100644 --- a/src/test/regress/output/gin_select.source +++ b/src/test/regress/output/gin_select.source @@ -3,12 +3,11 @@ CREATE DATABASE db_gin_utf8 TEMPLATE template0 encoding 'UTF8'; SET ENABLE_SEQSCAN=OFF; SET ENABLE_INDEXSCAN=OFF; SET ENABLE_BITMAPSCAN=ON; -SET ENABLE_FAST_QUERY_SHIPPING=OFF; --- import data -create table import_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text) distribute by hash (id); -copy import_data from '@abs_srcdir@/data/gin_data_1000.txt'; +create table import_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text); +copy import_data from '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/gin_data_1000.txt'; --- import data then create index -create table gin_test_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text) distribute by hash (id); +create table gin_test_data(id int, chepai varchar(10), shenfenzheng varchar(20), duanxin text); insert into gin_test_data select 1, chepai, shenfenzheng, duanxin from import_data; --- 6 times insert into gin_test_data select * from gin_test_data; @@ -59,7 +58,7 @@ select count(*) from gin_test_data where to_tsvector('ngram', shenfenzheng) @@ t (1 row) --- gin data page split -create table gin_test_data_1(id int, shenfenzheng varchar(20)) distribute by hash (id); +create table gin_test_data_1(id int, shenfenzheng varchar(20)); insert into gin_test_data_1 select id, shenfenzheng from gin_test_data; --- 7 times insert into gin_test_data_1 select * from gin_test_data_1; diff --git a/src/test/regress/output/gs_guc.source b/src/test/regress/output/gs_guc.source index d8ce8c87e..a2f0b7d4e 100644 --- a/src/test/regress/output/gs_guc.source +++ b/src/test/regress/output/gs_guc.source @@ -1,48 +1,46 @@ -\! @abs_bindir@/gs_guc check -D @abs_srcdir@/tmp_check/datanode1/ -c max_stack_depth ---?The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c max_stack_depth check ]. ---?.* ---?.* ---?expected guc information: .*: max_stack_depth=.* ---?gs_guc check: .*: max_stack_depth=.* +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc check -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c max_stack_depth +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c max_stack_depth check ]. +expected guc information: ecs-7159: max_stack_depth=NULL: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc check: ecs-7159: max_stack_depth=NULL: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total GUC values: 1. Failed GUC values: 0. The details for max_stack_depth: ---?.*max_stack_depth=.* + [ecs-7159] max_stack_depth=NULL [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] -\! @abs_bindir@/gs_guc -V ---?gs_guc .* -\! @abs_bindir@/gs_guc -? +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -V +gs_guc (openGauss) 9.2.4 +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -? gs_guc is an inferface to modify config files or encrypt plain text to cipher text. Checking GUC parameters: - gs_guc check [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c "parameter", -c "parameter", ...} - gs_guc check [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c parameter, -c parameter, ...} + gs_guc check [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c "parameter", -c "parameter", ...} + gs_guc check [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c parameter, -c parameter, ...} Configuring GUC parameters: Usage: - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] {-c "parameter = value" -c "parameter = value" ...} - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] {-c " parameter = value " -c " parameter = value " ...} - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] {-c "parameter = 'value'" -c "parameter = 'value'" ...} - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] {-c " parameter = 'value' " -c " parameter = 'value' " ...} - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] {-c "parameter" -c "parameter" ...} - e.g. gs_guc set -N all -I all -c "program = '\"Hello\", World\!'". - e.g. gs_guc reload -N all -I all -c "program = '\"Hello\", World\!'". + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] [--ignore-node=NODES] {-c "parameter = value" -c "parameter = value" ...} + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] [--ignore-node=NODES] {-c " parameter = value " -c " parameter = value " ...} + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] [--ignore-node=NODES] {-c "parameter = 'value'" -c "parameter = 'value'" ...} + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] [--ignore-node=NODES] {-c " parameter = 'value' " -c " parameter = 'value' " ...} + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--lcname=LCNAME] [--ignore-node=NODES] {-c "parameter" -c "parameter" ...} + e.g. gs_guc set -Z datanode -N all -I all -c "program = '\"Hello\", World\!'". + e.g. gs_guc reload -Z datanode -N all -I all -c "program = '\"Hello\", World\!'". If parameter value set or reload to DEFAULT OR COMMENT configuration parameter, use the form: -c "parameter" You can choose Usage as you like, and perhaps the first one will be more suitable for you! Configuring Authentication Policy: - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h "HOSTTYPE DATABASE USERNAME IPADDR IPMASK AUTHMEHOD authentication-options" - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h "HOSTTYPE DATABASE USERNAME IPADDR-WITH-IPMASK AUTHMEHOD authentication-options" - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h "HOSTTYPE DATABASE USERNAME HOSTNAME AUTHMEHOD authentication-options" + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--ignore-node=NODES] -h "HOSTTYPE DATABASE USERNAME IPADDR IPMASK AUTHMEHOD authentication-options" + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--ignore-node=NODES] -h "HOSTTYPE DATABASE USERNAME IPADDR-WITH-IPMASK AUTHMEHOD authentication-options" + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--ignore-node=NODES] -h "HOSTTYPE DATABASE USERNAME HOSTNAME AUTHMEHOD authentication-options" If authentication policy need to set/reload DEFAULT OR COMMENT then provide without authentication menthod, use the form: - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h "HOSTTYPE DATABASE USERNAME IPADDR IPMASK" - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h "HOSTTYPE DATABASE USERNAME IPADDR-WITH-IPMASK " - gs_guc {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h "HOSTTYPE DATABASE USERNAME HOSTNAME" + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--ignore-node=NODES] -h "HOSTTYPE DATABASE USERNAME IPADDR IPMASK" + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--ignore-node=NODES] -h "HOSTTYPE DATABASE USERNAME IPADDR-WITH-IPMASK " + gs_guc {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} [--ignore-node=NODES] -h "HOSTTYPE DATABASE USERNAME HOSTNAME" Encrypt plain text to cipher text: - gs_guc encrypt [-M keymode] -K password [-U username] -D DATADIR + gs_guc encrypt [-M keymode] -K password [-U username] {-D DATADIR | -R RANDFILEDIR -C CIPHERFILEDIR} Generate plain cipher key to cipher text: gs_guc generate [-o prefix] -S cipherkey -D DATADIR @@ -54,81 +52,77 @@ Common options: -c parameter=value the parameter to set -c parameter the parameter value to DEFAULT (i.e comments in configuration file) --lcname=LCNAME logical cluter name. It only can be used with datanode + --ignore-node=NODES Nodes which need to ignore. It only can be used with set/reload operation,and CN/DN nodetype -h host-auth-policy to set authentication policy in HBA conf file -?, --help show this help, then exit -V, --version output version information, then exit +Options for set with -c parameter: + -Z NODE-TYPE can be "datanode", "cmserver" or "cmagent". NODE-TYPE is used to identify configuration file (with -c parameter) in data directory + "datanode" -- postgresql.conf + "cmserver" -- cm_server.conf + "cmagent" -- cm_agent.conf + +Options for set and reload with -h host-auth-policy: + -Z NODE-TYPE can only be "datanode" + Options for encrypt: -M, --keymode=MODE the cipher files will be applies in server, client or source,default value is server mode -K PASSWORD the plain password you want to encrypt, which length should between 8~16 and at least 3 different types of characters -U, --keyuser=USER if appointed, the cipher files will name with the user name + -R RANDFILEDIR set the dir that put the rand file + -C CIPHERFILEDIR set the dir that put the cipher file Options for generate: -o PREFIX the cipher files prefix. default value is obsserver -S CIPHERKEY the plain password you want to encrypt, which length should between 8~16 and at least 3 different types of characters -----Check(GUC) -\! @abs_bindir@/gs_guc check -D @abs_srcdir@/tmp_check/datanode1/ -c cstore_buffers ---?The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c cstore_buffers check ]. ---?.* ---?.* ---?expected guc information: .*: cstore_buffers=.* ---?gs_guc check: .*: cstore_buffers=.* +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc check -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c cstore_buffers +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c cstore_buffers check ]. +expected guc information: ecs-7159: cstore_buffers=NULL: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc check: ecs-7159: cstore_buffers=512MB: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total GUC values: 1. Failed GUC values: 0. The value of parameter cstore_buffers is same on all instances. ---? cstore_buffers=.* + cstore_buffers=512MB -----Set(GUC) -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "cstore_buffers=10GB" ---?The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c cstore_buffers=10GB set ]. ---?.* ---?.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: cstore_buffers=10GB: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "cstore_buffers=10GB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c cstore_buffers=10GB set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: cstore_buffers=10GB: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_beta_opfusion=on" -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: enable_beta_opfusion=on: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "intervalstyle=a" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c intervalstyle=a set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: intervalstyle=a: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_beta_nestloop_fusion=on" -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: enable_beta_nestloop_fusion=on: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "enable_beta_opfusion=on" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c enable_beta_opfusion=on set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: enable_beta_opfusion=on: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "enable_beta_nestloop_fusion=on" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c enable_beta_nestloop_fusion=on set ]. +ERROR: The name of parameter "enable_beta_nestloop_fusion" is incorrect. It is not within the CN/DN support parameters or it is a read only parameter. +Try "gs_guc --help" for more information. -----Reload(GUC) -\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "cstore_buffers=10GB" -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc reload: cstore_buffers=10GB: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc reload -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "cstore_buffers=10GB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c cstore_buffers=10GB reload ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc reload: cstore_buffers=10GB: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] server signaled Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "intervalstyle=a" ---?The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c intervalstyle=a set ]. ---?.* ---?.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: intervalstyle=a: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] - -Total instances: 1. Failed instances: 0. -Success to perform gs_guc! - -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "intervalstyle=a" ---?The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c cstore_buffers=10GB reload ]. ---?.* ---?.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: intervalstyle=a: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] - -Total instances: 1. Failed instances: 0. -Success to perform gs_guc! \ No newline at end of file diff --git a/src/test/regress/output/gs_guc_reload.source b/src/test/regress/output/gs_guc_reload.source index 5e2c13b5a..28da48659 100644 --- a/src/test/regress/output/gs_guc_reload.source +++ b/src/test/regress/output/gs_guc_reload.source @@ -1,16 +1,15 @@ -----gs_guc_reload(GUC) set default value of lockwait_timeout by gs_guc reload --set new value -\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "lockwait_timeout=1s" -The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c lockwait_timeout=1s reload ]. -realpath(@abs_bindir@/..//bin/cluster_static_config) failed : No such file or directory! -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc reload: lockwait_timeout=1s: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc reload -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "lockwait_timeout=1s" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c lockwait_timeout=1s reload ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc reload: lockwait_timeout=1s: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] server signaled Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! sleep 10s +\! sleep 3s show lockwait_timeout; lockwait_timeout ------------------ @@ -18,22 +17,19 @@ show lockwait_timeout; (1 row) --no assign value -\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "lockwait_timeout" -The gs_guc run with the following arguments: [@abs_bindir@/gs_guc -D @abs_srcdir@/tmp_check/datanode1/ -c lockwait_timeout reload ]. -realpath(@abs_bindir@/..//bin/cluster_static_config) failed : No such file or directory! -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -ERROR: lockwait_timeout parameters value is expected +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc reload -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "lockwait_timeout" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c lockwait_timeout reload ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc reload: #lockwait_timeout: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +server signaled -Total instances: 1. Failed instances: 1. -Failed instance information: ---?.* +Total instances: 1. Failed instances: 0. +Success to perform gs_guc! -Failure to perform gs_guc! - -\! sleep 10s +\! sleep 3s show lockwait_timeout; lockwait_timeout ------------------ - 1s + 20min (1 row) diff --git a/src/test/regress/output/gs_guc_value_range.source b/src/test/regress/output/gs_guc_value_range.source index e3b4ec37f..d7d22ac7e 100644 --- a/src/test/regress/output/gs_guc_value_range.source +++ b/src/test/regress/output/gs_guc_value_range.source @@ -1,130 +1,146 @@ -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_freeze_max_age=8888" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_freeze_max_age=8888" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_freeze_max_age=8888 set ]. ERROR: The value 8888 is outside the valid range for parameter "autovacuum_freeze_max_age" (100000 .. 576460752303423487). -ERROR: The value "8888" for parameter "autovacuum_freeze_max_age" is incorrect. +ERROR: The value "8888" for parameter "autovacuum_freeze_max_age" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_freeze_max_age=8000000" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: autovacuum_freeze_max_age=8000000: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_freeze_max_age=8000000" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_freeze_max_age=8000000 set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: autovacuum_freeze_max_age=8000000: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_freeze_max_age=576460752303423488" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_freeze_max_age=576460752303423488" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_freeze_max_age=576460752303423488 set ]. ERROR: The value 576460752303423488 is outside the valid range for parameter "autovacuum_freeze_max_age" (100000 .. 576460752303423487). -ERROR: The value "576460752303423488" for parameter "autovacuum_freeze_max_age" is incorrect. +ERROR: The value "576460752303423488" for parameter "autovacuum_freeze_max_age" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=254789435kB" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: bulk_write_ring_size=254789435kB: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=254789435kB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=254789435kB set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: bulk_write_ring_size=254789435kB: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=23546435kN" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=23546435kN" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=23546435kN set ]. ERROR: Valid units for this parameter "bulk_write_ring_size" are "kB", "MB" and "GB". ERROR: The parameter "bulk_write_ring_size" requires an integer value. -ERROR: The value "23546435kN" for parameter "bulk_write_ring_size" is incorrect. +ERROR: The value "23546435kN" for parameter "bulk_write_ring_size" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=900MB" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: bulk_write_ring_size=900MB: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=900MB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=900MB set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: bulk_write_ring_size=900MB: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=2791353MB" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=2791353MB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=2791353MB set ]. ERROR: The value 2858345472 is outside the valid range for parameter "bulk_write_ring_size" (16384 .. 2147483647). -ERROR: The value "2791353MB" for parameter "bulk_write_ring_size" is incorrect. +ERROR: The value "2791353MB" for parameter "bulk_write_ring_size" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=9007199254900000MB" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=9007199254900000MB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=9007199254900000MB set ]. ERROR: The parameter "bulk_write_ring_size" requires an integer value. -ERROR: The value "9007199254900000MB" for parameter "bulk_write_ring_size" is incorrect. +ERROR: The value "9007199254900000MB" for parameter "bulk_write_ring_size" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=87GB" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: bulk_write_ring_size=87GB: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=87GB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=87GB set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: bulk_write_ring_size=87GB: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=8791GB" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=8791GB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=8791GB set ]. ERROR: The value 9218031616 is outside the valid range for parameter "bulk_write_ring_size" (16384 .. 2147483647). -ERROR: The value "8791GB" for parameter "bulk_write_ring_size" is incorrect. +ERROR: The value "8791GB" for parameter "bulk_write_ring_size" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bulk_write_ring_size=8796093022900GB" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bulk_write_ring_size=8796093022900GB" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bulk_write_ring_size=8796093022900GB set ]. ERROR: The parameter "bulk_write_ring_size" requires an integer value. -ERROR: The value "8796093022900GB" for parameter "bulk_write_ring_size" is incorrect. +ERROR: The value "8796093022900GB" for parameter "bulk_write_ring_size" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=15372286s" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=15372286s" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=15372286s set ]. ERROR: The value 15372286 is outside the valid range for parameter "autovacuum_naptime" (1 .. 2147483). -ERROR: The value "15372286s" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "15372286s" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=254mi" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=254mi" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=254mi set ]. ERROR: Valid units for this parameter "autovacuum_naptime" are "s", "min", "h", and "d". ERROR: The parameter "autovacuum_naptime" requires an integer value. -ERROR: The value "254mi" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "254mi" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=153min" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: autovacuum_naptime=153min: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=153min" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=153min set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: autovacuum_naptime=153min: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=254857min" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=254857min" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=254857min set ]. ERROR: The value 15291420 is outside the valid range for parameter "autovacuum_naptime" (1 .. 2147483). -ERROR: The value "254857min" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "254857min" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=1537228672000000000min" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=1537228672000000000min" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=1537228672000000000min set ]. ERROR: The parameter "autovacuum_naptime" requires an integer value. -ERROR: The value "1537228672000000000min" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "1537228672000000000min" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=65h" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: autovacuum_naptime=65h: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=65h" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=65h set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: autovacuum_naptime=65h: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=25645h" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=25645h" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=25645h set ]. ERROR: The value 92322000 is outside the valid range for parameter "autovacuum_naptime" (1 .. 2147483). -ERROR: The value "25645h" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "25645h" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=2562047788015216h" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=2562047788015216h" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=2562047788015216h set ]. ERROR: The parameter "autovacuum_naptime" requires an integer value. -ERROR: The value "2562047788015216h" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "2562047788015216h" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=5d" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: autovacuum_naptime=5d: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=5d" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=5d set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: autovacuum_naptime=5d: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=256d" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=256d" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=256d set ]. ERROR: The value 22118400 is outside the valid range for parameter "autovacuum_naptime" (1 .. 2147483). -ERROR: The value "256d" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "256d" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "autovacuum_naptime=114841866167300d" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "autovacuum_naptime=114841866167300d" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c autovacuum_naptime=114841866167300d set ]. ERROR: The parameter "autovacuum_naptime" requires an integer value. -ERROR: The value "114841866167300d" for parameter "autovacuum_naptime" is incorrect. +ERROR: The value "114841866167300d" for parameter "autovacuum_naptime" is incorrect, requires a integer value Try "gs_guc --help" for more information. -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bgwriter_lru_multiplier=6.6" ---?realpath.* -expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] -gs_guc set: bgwriter_lru_multiplier=6.6: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf] +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bgwriter_lru_multiplier=6.6" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bgwriter_lru_multiplier=6.6 set ]. +expected instance path: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] +gs_guc set: bgwriter_lru_multiplier=6.6: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/postgresql.conf] Total instances: 1. Failed instances: 0. Success to perform gs_guc! -\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "bgwriter_lru_multiplier=11.2" +\! /usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc set -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c "bgwriter_lru_multiplier=11.2" +The gs_guc run with the following arguments: [/usr3/data1/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data1/jiangyan/openGauss-server//dest/bin/gs_guc -D /usr3/data1/jiangyan/openGauss-server/src/test/regress/tmp_check/datanode1/ -c bgwriter_lru_multiplier=11.2 set ]. ERROR: The value 11.2 is outside the valid range for parameter "bgwriter_lru_multiplier" (0 .. 10). -ERROR: The value "11.2" for parameter "bgwriter_lru_multiplier" is incorrect. +ERROR: The value "11.2" for parameter "bgwriter_lru_multiplier" is incorrect, requires a string value Try "gs_guc --help" for more information. diff --git a/src/test/regress/output/hw_cstore_analyze.source b/src/test/regress/output/hw_cstore_analyze.source index 7f35f7e4d..0d11d6470 100644 --- a/src/test/regress/output/hw_cstore_analyze.source +++ b/src/test/regress/output/hw_cstore_analyze.source @@ -19,9 +19,8 @@ CREATE TABLE lineitem_with_null , L_SHIPMODE CHAR(10) , L_COMMENT VARCHAR(44) ) -with (orientation = column) -distribute by hash(L_ORDERKEY); -COPY lineitem_with_null FROM '@abs_srcdir@/data/lineitem.data' with (format 'text', delimiter '|', null ''); +with (orientation = column); +COPY lineitem_with_null FROM '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/lineitem.data' with (format 'text', delimiter '|', null ''); analyze lineitem_with_null; analyze lineitem_with_null(L_PARTKEY); analyze lineitem_with_null(L_SHIPMODE); diff --git a/src/test/regress/output/hw_cstore_btree_index.source b/src/test/regress/output/hw_cstore_btree_index.source index 76615c07c..a8c723ffa 100644 --- a/src/test/regress/output/hw_cstore_btree_index.source +++ b/src/test/regress/output/hw_cstore_btree_index.source @@ -1,21 +1,23 @@ -create schema cstore_btree_index; -set current_schema = cstore_btree_index; --- --case 1: unsupported index test --- +DROP TABLE if exists cstore_insert_t1; +NOTICE: table "cstore_insert_t1" does not exist, skipping +DROP TABLE if exists row_table; +NOTICE: table "row_table" does not exist, skipping CREATE TABLE cstore_insert_t1(c1 int, c2 float, c3 text) WITH (orientation = column); -COPY cstore_insert_t1 FROM '@abs_srcdir@/data/cstore_copy_t2.data' DELIMITER ','; -CREATE UNIQUE INDEX unsupport1_idx ON cstore_insert_t1 using btree(c1); -ERROR: access method "cbtree" does not support unique indexes -CREATE INDEX CONCURRENTLY unsupport2_idx ON cstore_insert_t1 using btree(c1); -ERROR: PGXC does not support concurrent INDEX yet +COPY cstore_insert_t1 FROM '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/cstore_copy_t2.data' DELIMITER ','; +CREATE UNIQUE INDEX unsupport1_idx ON cstore_insert_t1(c1); +ERROR: access method "psort" does not support unique indexes +CREATE INDEX CONCURRENTLY unsupport2_idx ON cstore_insert_t1(c1); +ERROR: column store table does not support concurrent INDEX yet DETAIL: The feature is not currently supported -CREATE INDEX unsupport3_idx ON cstore_insert_t1 using btree(lower(c2)); -ERROR: access method "cbtree" does not support index expressions -CREATE INDEX unsupport4_idx ON cstore_insert_t1 using btree(c1) where c1 > 1; -ERROR: access method "cbtree" does not support WHERE clause -CREATE INDEX unsupport5_idx ON cstore_insert_t1 using btree(c2 NULLS FIRST); -ERROR: access method "cbtree" does not support NULLS FIRST/LAST options +CREATE INDEX unsupport3_idx ON cstore_insert_t1(lower(c2)); +ERROR: access method "psort" does not support index expressions +CREATE INDEX unsupport4_idx ON cstore_insert_t1(c1) where c1 > 1; +ERROR: access method "psort" does not support WHERE clause +CREATE INDEX unsupport5_idx ON cstore_insert_t1(c2 NULLS FIRST); +ERROR: access method "psort" does not support NULLS FIRST/LAST options CREATE INDEX unsupport6_idx ON cstore_insert_t1 USING hash (c1); ERROR: access method "hash" does not support column store CREATE INDEX unsupport7_idx ON cstore_insert_t1 USING gist (c1); @@ -23,12 +25,12 @@ ERROR: access method "gist" does not support column store CREATE INDEX unsupport9_idx ON cstore_insert_t1 USING spgist (c1); ERROR: access method "spgist" does not support column store CREATE INDEX unsupport10_idx ON cstore_insert_t1 USING btree (c1); -COPY cstore_insert_t1 FROM '@abs_srcdir@/data/cstore_copy_t2.data' DELIMITER ','; -DROP TABLE cstore_insert_t1; +COPY cstore_insert_t1 FROM '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/cstore_copy_t2.data' DELIMITER ','; +DROP TABLE if exists cstore_insert_t1; CREATE TABLE row_table(c1 int, c2 float, c3 text); CREATE INDEX unsupport11_idx ON row_table USING psort (c1); ERROR: access method "psort" does not support row store -DROP TABLE row_table; +DROP TABLE if exists row_table; ----------- ---case 2: partition table create index test ----------- @@ -53,7 +55,6 @@ CREATE TABLE LINEITEM --, primary key (L_ORDERKEY, L_LINENUMBER) ) with (orientation = column) -distribute by hash(L_ORDERKEY) PARTITION BY RANGE(L_SHIPDATE) ( PARTITION p1 VALUES LESS THAN('1993-01-01 00:00:00'), @@ -64,13 +65,13 @@ PARTITION BY RANGE(L_SHIPDATE) PARTITION p6 VALUES LESS THAN('1998-01-01 00:00:00'), PARTITION p7 VALUES LESS THAN('2030-01-01 00:00:00') ); -COPY LINEITEM FROM '@abs_srcdir@/data/lineitem_index.data' DELIMITER '|'; -create index idx1 on lineitem using btree(L_ORDERKEY) local; -create index idx2 on lineitem using btree(L_PARTKEY) local; -create index idx3 on lineitem using btree(L_LINENUMBER, L_SHIPDATE) local; -create index idx4 on lineitem using btree(L_RETURNFLAG) local; -create index idx5 on lineitem using btree(L_LINESTATUS, L_SHIPINSTRUCT) local; -COPY LINEITEM FROM '@abs_srcdir@/data/lineitem_index.data' DELIMITER '|'; +COPY LINEITEM FROM '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/lineitem_index.data' DELIMITER '|'; +create index idx1 on lineitem(L_ORDERKEY) local; +create index idx2 on lineitem(L_PARTKEY) local; +create index idx3 on lineitem(L_LINENUMBER, L_SHIPDATE) local; +create index idx4 on lineitem(L_RETURNFLAG) local; +create index idx5 on lineitem(L_LINESTATUS, L_SHIPINSTRUCT) local; +COPY LINEITEM FROM '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/lineitem_index.data' DELIMITER '|'; set enable_bitmapscan=off; set enable_seqscan=off; select count(*) from lineitem where L_ORDERKEY > 100 and L_ORDERKEY < 200; @@ -80,42 +81,38 @@ select count(*) from lineitem where L_ORDERKEY > 100 and L_ORDERKEY < 200; (1 row) truncate table lineitem; -drop index idx1; -drop index idx2; -drop index idx3; -drop index idx4; -drop index idx5; -drop table lineitem; -------- ---- case 8: index scan with none partition hit -------- -CREATE TABLE partition_none ( - a1 character varying(1000), - a2 integer, - a3 character varying(1000), - a4 integer, - a5 character varying(1000), - a6 integer, - a7 character varying(1000), - a8 integer, - a9 character varying(1000), - a10 integer -) -WITH (orientation=column) -DISTRIBUTE BY HASH (a4) -PARTITION BY RANGE (a2) -( - PARTITION p1 VALUES LESS THAN (1), - PARTITION p50001 VALUES LESS THAN (50001), - PARTITION p100001 VALUES LESS THAN (100001), - PARTITION p150001 VALUES LESS THAN (150001), - PARTITION p200001 VALUES LESS THAN (200001), - PARTITION p250001 VALUES LESS THAN (250001)); -create index aii on partition_none using btree(a9) local; -SELECT a1, a9 FROM /*TaRgET*/ partition_none WHERE a5='ata l' AND 6793839=a2 AND a2=6159730 AND a9='da' ORDER BY a1, a9; - a1 | a9 -----+---- +drop index if exists idx1; +drop index if exists idx2; +drop index if exists idx3; +drop index if exists idx4; +drop index if exists idx5; +drop table if exists lineitem; +---- +--case 3: check reserve column +---- +CREATE TABLE check_column(id int, tid int); +ERROR: column name "tid" conflicts with a system column name +CREATE TABLE check_column(id int, tid_test int, ti int); +ALTER TABLE check_column ADD COLUMN tid int; +ERROR: column name "tid" conflicts with a system column name +drop table if exists check_column; +----- +--- case 6: truncate and delete cstore relation with index +----- +create table IDEX_PARTITION_TABLE_001(COL_INT int) with(orientation=column); +CREATE INDEX STORAGE_IDEX_PARTITION_IDEX_001 ON IDEX_PARTITION_TABLE_001(COL_INT); +insert into IDEX_PARTITION_TABLE_001 values(1000); +truncate table IDEX_PARTITION_TABLE_001; +select * from IDEX_PARTITION_TABLE_001; + col_int +--------- (0 rows) -drop table partition_none; -drop schema cstore_btree_index cascade; +insert into IDEX_PARTITION_TABLE_001 values(1000); +delete from IDEX_PARTITION_TABLE_001 where col_int=1000; +select * from IDEX_PARTITION_TABLE_001 where col_int=1000; + col_int +--------- +(0 rows) + +drop table if exists IDEX_PARTITION_TABLE_001; diff --git a/src/test/regress/output/hw_cstore_btree_index1.source b/src/test/regress/output/hw_cstore_btree_index1.source index 1fa3435fc..6bccbf4ce 100644 --- a/src/test/regress/output/hw_cstore_btree_index1.source +++ b/src/test/regress/output/hw_cstore_btree_index1.source @@ -22,7 +22,7 @@ create table row_index_tbl( ,num2 decimal ,serial1 int ,interval1 interval - ,interval2 tinterval) distribute by hash(id2); + ,interval2 tinterval); insert into row_index_tbl values(10,400,2000,40000,1,111111,1.1,'a','aa','bb','cc','dd','ff','1996-02-12','1984-2-6 01:00:30+8','02:05:36',30.12,0.03,2147483647,'2 day 13:34:56','["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]'); insert into row_index_tbl values(20,300,3000,10000,2,222222,2.2,'b','ee','cc','dd','aa','hh','1998-03-24','1986-2-6 03:00:30+8','04:36:25',20.15,0.06,-2147483647,'1 day 18:34:56','["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]'); insert into row_index_tbl values(30,200,4000,30000,3,333333,3.3,'c','cc','bb','aa','ee','gg','1997-05-26','1987-2-6 08:00:30+8','06:36:18',34.36,0.07,2136483647,'18 day 14:34:56','["Feb 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]'); @@ -48,64 +48,58 @@ create table cstore_index_tbl( ,num2 decimal ,serial1 int ,interval1 interval - ,interval2 tinterval)with(orientation=column) distribute by hash(id2); + ,interval2 tinterval)with(orientation=column); insert into cstore_index_tbl select * from row_index_tbl; select ctid from cstore_index_tbl order by 1; ctid ---------- (1001,1) - (1001,1) - (1001,1) - (1001,1) + (1001,2) + (1001,3) + (1001,4) (4 rows) -create index idx_int1 on cstore_index_tbl using btree(id1); -create index idx_int2 on cstore_index_tbl using btree(id2); -create index idx_int4 on cstore_index_tbl using btree(id4); -create index idx_int8 on cstore_index_tbl using btree(id8); -create index idx_int on cstore_index_tbl using btree(int1); -create index idx_bigint on cstore_index_tbl using btree(bint); -create index idx_float on cstore_index_tbl using btree(flag); -create index idx_varchar on cstore_index_tbl using btree(name1); -create index idx_varchar2 on cstore_index_tbl using btree(name2); -create index idx_nvarchar2 on cstore_index_tbl using btree(name3); -create index idx_text on cstore_index_tbl using btree(name4); -create index idx_date on cstore_index_tbl using btree(time1); -create index idx_timetz on cstore_index_tbl using btree(time2); -create index idx_time on cstore_index_tbl using btree(time3); -create index idx_float8 on cstore_index_tbl using btree(num1); -create index idx_decimal on cstore_index_tbl using btree(num2); -create index idx_serial on cstore_index_tbl using btree(serial1); -create index idx_interval on cstore_index_tbl using btree(interval1); -create index idx_tinterval on cstore_index_tbl using btree(interval2); -create index idx_id4_name1 on cstore_index_tbl using btree(id4,name1); -create index idx_id4_name2 on cstore_index_tbl using btree(id4,name2); -create index idx_id4_name3 on cstore_index_tbl using btree(id4,name3); -create index idx_id4_name4 on cstore_index_tbl using btree(id4,name4); -create index idx_bint_flag on cstore_index_tbl using btree(bint,flag); -create index idx_int1_time on cstore_index_tbl using btree(int1,time3); -create index idx_time1_name2 on cstore_index_tbl using btree(time1,name2); -create index idx_id4_time2 on cstore_index_tbl using btree(id4,time2); -create index idx_num1_time2 on cstore_index_tbl using btree(num1,time2); -create index idx_id4_num2 on cstore_index_tbl using btree(id4,num2); -create index idx_name1_name2 on cstore_index_tbl using btree(name1,name2); -create index idx_time1_interval1 on cstore_index_tbl using btree(time1,interval1); +create index idx_int1 on cstore_index_tbl(id1); +create index idx_int2 on cstore_index_tbl(id2); +create index idx_int4 on cstore_index_tbl(id4); +create index idx_int8 on cstore_index_tbl(id8); +create index idx_int on cstore_index_tbl(int1); +create index idx_bigint on cstore_index_tbl(bint); +create index idx_float on cstore_index_tbl(flag); +create index idx_varchar on cstore_index_tbl(name1); +create index idx_varchar2 on cstore_index_tbl(name2); +create index idx_nvarchar2 on cstore_index_tbl(name3); +create index idx_text on cstore_index_tbl(name4); +create index idx_date on cstore_index_tbl(time1); +create index idx_timetz on cstore_index_tbl(time2); +create index idx_time on cstore_index_tbl(time3); +create index idx_float8 on cstore_index_tbl(num1); +create index idx_decimal on cstore_index_tbl(num2); +create index idx_serial on cstore_index_tbl(serial1); +create index idx_interval on cstore_index_tbl(interval1); +create index idx_tinterval on cstore_index_tbl(interval2); +create index idx_id4_name1 on cstore_index_tbl(id4,name1); +create index idx_id4_name2 on cstore_index_tbl(id4,name2); +create index idx_id4_name3 on cstore_index_tbl(id4,name3); +create index idx_id4_name4 on cstore_index_tbl(id4,name4); +create index idx_bint_flag on cstore_index_tbl(bint,flag); +create index idx_int1_time on cstore_index_tbl(int1,time3); +create index idx_time1_name2 on cstore_index_tbl(time1,name2); +create index idx_id4_time2 on cstore_index_tbl(id4,time2); +create index idx_num1_time2 on cstore_index_tbl(num1,time2); +create index idx_id4_num2 on cstore_index_tbl(id4,num2); +create index idx_name1_name2 on cstore_index_tbl(name1,name2); +create index idx_time1_interval1 on cstore_index_tbl(time1,interval1); set enable_seqscan=off; explain (verbose on, costs off) select * from cstore_index_tbl where id2 > 100; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_int2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_int2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.id2 > 100) -(9 rows) + Index Cond: (cstore_index_tbl.id2 > 100) +(5 rows) select * from cstore_index_tbl where id2 > 100 order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -116,20 +110,14 @@ select * from cstore_index_tbl where id2 > 100 order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where id4 > 1000; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.id4) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_id4_num2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_id4_num2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.id4 > 1000) -(9 rows) + Index Cond: (cstore_index_tbl.id4 > 1000) +(5 rows) select * from cstore_index_tbl where id4 > 1000 order by id4; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -140,20 +128,14 @@ select * from cstore_index_tbl where id4 > 1000 order by id4; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where id8 > 10000; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.id8) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_int8 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_int8 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.id8 > 10000) -(9 rows) + Index Cond: (cstore_index_tbl.id8 > 10000) +(5 rows) select * from cstore_index_tbl where id8 > 10000 order by id8; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -164,20 +146,14 @@ select * from cstore_index_tbl where id8 > 10000 order by id8; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where name1 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: ((cstore_index_tbl.name1)::text > 'aa'::text) -(9 rows) + Index Cond: ((cstore_index_tbl.name1)::text > 'aa'::text) +(5 rows) select * from cstore_index_tbl where name1 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -188,20 +164,14 @@ select * from cstore_index_tbl where name1 > 'aa' order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where name2 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: ((cstore_index_tbl.name2)::text > 'aa'::text) -(9 rows) + Index Cond: ((cstore_index_tbl.name2)::text > 'aa'::text) +(5 rows) select * from cstore_index_tbl where name2 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -213,20 +183,14 @@ select * from cstore_index_tbl where name2 > 'aa' order by id2; (4 rows) explain (verbose on, costs off) select * from cstore_index_tbl where name3 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name3) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_id4_name3 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_id4_name3 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: ((cstore_index_tbl.name3)::text > 'aa'::text) -(9 rows) + Index Cond: ((cstore_index_tbl.name3)::text > 'aa'::text) +(5 rows) select * from cstore_index_tbl where name3 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -236,20 +200,14 @@ select * from cstore_index_tbl where name3 > 'aa' order by id2; (2 rows) explain (verbose on, costs off) select * from cstore_index_tbl where name4 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name4) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_id4_name4 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_id4_name4 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.name4 > 'aa'::text) -(9 rows) + Index Cond: (cstore_index_tbl.name4 > 'aa'::text) +(5 rows) select * from cstore_index_tbl where name4 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -260,20 +218,14 @@ select * from cstore_index_tbl where name4 > 'aa' order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where time1 > '1992-01-30'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.time1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.time1 > 'Thu Jan 30 00:00:00 1992'::timestamp without time zone) -(9 rows) + Index Cond: (cstore_index_tbl.time1 > 'Thu Jan 30 00:00:00 1992'::timestamp without time zone) +(5 rows) select * from cstore_index_tbl where time1 > '1992-01-30' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -284,20 +236,14 @@ select * from cstore_index_tbl where time1 > '1992-01-30' order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where time2 > '1984-2-6 01:00:30+8'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.time2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_num1_time2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_num1_time2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.time2 > '01:00:30+08'::time with time zone) -(9 rows) + Index Cond: (cstore_index_tbl.time2 > '01:00:30+08'::time with time zone) +(5 rows) select * from cstore_index_tbl where time2 > '1984-2-6 01:00:30+8' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -308,20 +254,14 @@ select * from cstore_index_tbl where time2 > '1984-2-6 01:00:30+8' order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where num1 > 20.20; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.num1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_num1_time2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_num1_time2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.num1 > 20.2::double precision) -(9 rows) + Index Cond: (cstore_index_tbl.num1 > 20.2::double precision) +(5 rows) select * from cstore_index_tbl where num1 > 20.20 order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -332,20 +272,14 @@ select * from cstore_index_tbl where num1 > 20.20 order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where num2 > 0.05; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.num2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_id4_num2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_id4_num2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.num2 > .05) -(9 rows) + Index Cond: (cstore_index_tbl.num2 > .05) +(5 rows) select * from cstore_index_tbl where num2 > 0.05 order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -355,20 +289,14 @@ select * from cstore_index_tbl where num2 > 0.05 order by id2; (2 rows) explain (verbose on, costs off) select * from cstore_index_tbl where serial1 > -2136483647; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.serial1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_serial on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_serial on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.serial1 > (-2136483647)) -(9 rows) + Index Cond: (cstore_index_tbl.serial1 > (-2136483647)) +(5 rows) select * from cstore_index_tbl where serial1 > -2136483647 order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -378,20 +306,14 @@ select * from cstore_index_tbl where serial1 > -2136483647 order by id2; (2 rows) explain (verbose on, costs off) select * from cstore_index_tbl where interval1 > '1 day 18:34:56'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.interval1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.interval1 > '@ 1 day 18 hours 34 mins 56 secs'::interval) -(9 rows) + Index Cond: (cstore_index_tbl.interval1 > '@ 1 day 18 hours 34 mins 56 secs'::interval) +(5 rows) select * from cstore_index_tbl where interval1 > '1 day 18:34:56' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -402,20 +324,14 @@ select * from cstore_index_tbl where interval1 > '1 day 18:34:56' order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where interval2 > '["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.interval2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_tinterval on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_tinterval on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.interval2 > '["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]'::tinterval) -(9 rows) + Index Cond: (cstore_index_tbl.interval2 > '["Sun Sep 04 23:59:12 1983 PDT" "Tue Oct 04 23:59:12 1983 PDT"]'::tinterval) +(5 rows) select * from cstore_index_tbl where interval2 > '["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -426,21 +342,15 @@ select * from cstore_index_tbl where interval2 > '["Sep 4, 1983 23:59:12" "Oct 4 (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where id2 > 100 and name1 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: ((cstore_index_tbl.name1)::text > 'aa'::text) - Filter: (cstore_index_tbl.id2 > 100) -(10 rows) + Index Cond: ((cstore_index_tbl.name1)::text > 'aa'::text) + Filter: (cstore_index_tbl.id2 > 100) +(6 rows) select * from cstore_index_tbl where id2 > 100 and name1 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -450,20 +360,14 @@ select * from cstore_index_tbl where id2 > 100 and name1 > 'aa' order by id2; (2 rows) explain (verbose on, costs off) select * from cstore_index_tbl where id4 > 1000 and name2 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.id4, public.cstore_index_tbl.name2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_id4_name2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_id4_name2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: ((cstore_index_tbl.id4 > 1000) AND ((cstore_index_tbl.name2)::text > 'aa'::text)) -(9 rows) + Index Cond: ((cstore_index_tbl.id4 > 1000) AND ((cstore_index_tbl.name2)::text > 'aa'::text)) +(5 rows) select * from cstore_index_tbl where id4 > 1000 and name2 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -474,21 +378,15 @@ select * from cstore_index_tbl where id4 > 1000 and name2 > 'aa' order by id2; (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where num1 > 20.5 and name3 > 'aa'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.num1, public.cstore_index_tbl.name3) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_num1_time2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_num1_time2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.num1 > 20.5::double precision) - Filter: ((cstore_index_tbl.name3)::text > 'aa'::text) -(10 rows) + Index Cond: (cstore_index_tbl.num1 > 20.5::double precision) + Filter: ((cstore_index_tbl.name3)::text > 'aa'::text) +(6 rows) select * from cstore_index_tbl where num1 > 20.5 and name3 > 'aa' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -497,21 +395,15 @@ select * from cstore_index_tbl where num1 > 20.5 and name3 > 'aa' order by id2; (1 row) explain (verbose on, costs off) select * from cstore_index_tbl where id4 > 1000 and time1 > '1992-01-30'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.id4, public.cstore_index_tbl.time1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.time1 > 'Thu Jan 30 00:00:00 1992'::timestamp without time zone) - Filter: (cstore_index_tbl.id4 > 1000) -(10 rows) + Index Cond: (cstore_index_tbl.time1 > 'Thu Jan 30 00:00:00 1992'::timestamp without time zone) + Filter: (cstore_index_tbl.id4 > 1000) +(6 rows) select * from cstore_index_tbl where id4 > 1000 and time1 > '1992-01-30' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -522,25 +414,18 @@ select * from cstore_index_tbl where id4 > 1000 and time1 > '1992-01-30' order b (3 rows) explain (verbose on, costs off) select * from cstore_index_tbl where flag > 'a' and time3 < '08:21:53' order by id2; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.flag, public.cstore_index_tbl.time3) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> Vector Sort Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Merge Sort Key: cstore_index_tbl.id2 - Node/s: All datanodes - -> Vector Sort + Sort Key: cstore_index_tbl.id2 + -> CStore Index Scan using idx_int1_time on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Sort Key: cstore_index_tbl.id2 - -> CStore Index Scan using idx_int1_time on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.time3 < '08:21:53'::time without time zone) - Filter: (cstore_index_tbl.flag > 'a'::bpchar) -(14 rows) + Index Cond: (cstore_index_tbl.time3 < '08:21:53'::time without time zone) + Filter: (cstore_index_tbl.flag > 'a'::bpchar) +(9 rows) select * from cstore_index_tbl where flag > 'a' and time3 < '08:21:53' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -550,20 +435,14 @@ select * from cstore_index_tbl where flag > 'a' and time3 < '08:21:53' order by (2 rows) explain (verbose on, costs off) select * from cstore_index_tbl where name1 > 'aa' and name2 > 'bb'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name1, public.cstore_index_tbl.name2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_name1_name2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (((cstore_index_tbl.name1)::text > 'aa'::text) AND ((cstore_index_tbl.name2)::text > 'bb'::text)) -(9 rows) + Index Cond: (((cstore_index_tbl.name1)::text > 'aa'::text) AND ((cstore_index_tbl.name2)::text > 'bb'::text)) +(5 rows) select * from cstore_index_tbl where name1 > 'aa' and name2 > 'bb' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -572,20 +451,14 @@ select * from cstore_index_tbl where name1 > 'aa' and name2 > 'bb' order by id2; (1 row) explain (verbose on, costs off) select * from cstore_index_tbl where time1 > '1996-02-12' and interval1 < '2 day 13:34:56'; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.time1, public.cstore_index_tbl.interval1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_time1_interval1 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: ((cstore_index_tbl.time1 > 'Mon Feb 12 00:00:00 1996'::timestamp without time zone) AND (cstore_index_tbl.interval1 < '@ 2 days 13 hours 34 mins 56 secs'::interval)) -(9 rows) + Index Cond: ((cstore_index_tbl.time1 > 'Mon Feb 12 00:00:00 1996'::timestamp without time zone) AND (cstore_index_tbl.interval1 < '@ 2 days 13 hours 34 mins 56 secs'::interval)) +(5 rows) select * from cstore_index_tbl where time1 > '1996-02-12' and interval1 < '2 day 13:34:56' order by id2; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -627,21 +500,15 @@ drop index idx_time1_interval1; drop index idx_bint_flag; set enable_seqscan=off; explain (verbose on, costs off) select * from cstore_index_tbl where id2 >100 and name1 < 'dd' and num1=30.12; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.id2, public.cstore_index_tbl.name1, public.cstore_index_tbl.num1) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------------------------------------------------------------------------------- Row Adapter Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - -> Vector Streaming (type: GATHER) + -> CStore Index Scan using idx_int2 on public.cstore_index_tbl Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Node/s: All datanodes - -> CStore Index Scan using idx_int2 on public.cstore_index_tbl - Output: id1, id2, id4, id8, int1, bint, f1, flag, name1, name2, name3, name4, name5, time1, time2, time3, num1, num2, serial1, interval1, interval2 - Distribute Key: id2 - Index Cond: (cstore_index_tbl.id2 > 100) - Filter: (((cstore_index_tbl.name1)::text < 'dd'::text) AND (cstore_index_tbl.num1 = 30.12::double precision)) -(10 rows) + Index Cond: (cstore_index_tbl.id2 > 100) + Filter: (((cstore_index_tbl.name1)::text < 'dd'::text) AND (cstore_index_tbl.num1 = 30.12::double precision)) +(6 rows) select * from cstore_index_tbl where id2 >100 and name1 < 'dd' and num1=30.12; id1 | id2 | id4 | id8 | int1 | bint | f1 | flag | name1 | name2 | name3 | name4 | name5 | time1 | time2 | time3 | num1 | num2 | serial1 | interval1 | interval2 @@ -652,52 +519,26 @@ select * from cstore_index_tbl where id2 >100 and name1 < 'dd' and num1=30.12; drop index idx_int2; drop table row_index_tbl; drop table cstore_index_tbl; ------ ---- case 6: truncate and delete cstore relation with index ------ -create table IDEX_PARTITION_TABLE_001(COL_INT int) with(orientation=column); -CREATE INDEX STORAGE_IDEX_PARTITION_IDEX_001 ON IDEX_PARTITION_TABLE_001 using btree(COL_INT); -insert into IDEX_PARTITION_TABLE_001 values(1000); -truncate table IDEX_PARTITION_TABLE_001; -select * from IDEX_PARTITION_TABLE_001; - col_int ---------- -(0 rows) - -insert into IDEX_PARTITION_TABLE_001 values(1000); -delete from IDEX_PARTITION_TABLE_001 where col_int=1000; -select * from IDEX_PARTITION_TABLE_001 where col_int=1000; - col_int ---------- -(0 rows) - -drop table IDEX_PARTITION_TABLE_001; ---- --- case 7: two indexes with the same column ---- -create table row_index_tbl(c1 int,c2 int,c3 int) distribute by hash(c1); +create table row_index_tbl(c1 int,c2 int,c3 int) ; insert into row_index_tbl values(0,1,2); insert into row_index_tbl values(3,4,5); insert into row_index_tbl values(6,7,8); insert into row_index_tbl values(9,10,11); -create table cstore_index_tbl(c1 int,c2 int,c3 int) with (orientation = column) distribute by hash(c1); +create table cstore_index_tbl(c1 int,c2 int,c3 int) with (orientation = column) ; insert into cstore_index_tbl select * from row_index_tbl; -create index idx_c2 on cstore_index_tbl using btree(c2); +create index idx_c2 on cstore_index_tbl(c2); explain (verbose on, costs off) SELECT c2 FROM cstore_index_tbl WHERE c2 > 2 and c2 < 9; -WARNING: Statistics in some tables or columns(public.cstore_index_tbl.c1, public.cstore_index_tbl.c2) are not collected. -HINT: Do analyze for them in order to generate optimized plan. - QUERY PLAN -------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------- Row Adapter Output: c2 - -> Vector Streaming (type: GATHER) + -> CStore Index Only Scan using idx_c2 on public.cstore_index_tbl Output: c2 - Node/s: All datanodes - -> CStore Index Only Scan using idx_c2 on public.cstore_index_tbl - Output: c2 - Distribute Key: c1 - Index Cond: ((cstore_index_tbl.c2 > 2) AND (cstore_index_tbl.c2 < 9)) -(9 rows) + Index Cond: ((cstore_index_tbl.c2 > 2) AND (cstore_index_tbl.c2 < 9)) +(5 rows) SELECT c2 FROM cstore_index_tbl WHERE c2 > 2 and c2 < 9 order by c2; c2 @@ -708,6 +549,37 @@ SELECT c2 FROM cstore_index_tbl WHERE c2 > 2 and c2 < 9 order by c2; drop table row_index_tbl; drop table cstore_index_tbl; +------- +--- case 8: index scan with none partition hit +------- +CREATE TABLE partition_none ( + a1 character varying(1000), + a2 integer, + a3 character varying(1000), + a4 integer, + a5 character varying(1000), + a6 integer, + a7 character varying(1000), + a8 integer, + a9 character varying(1000), + a10 integer +) +WITH (orientation=column) +PARTITION BY RANGE (a2) +( + PARTITION p1 VALUES LESS THAN (1), + PARTITION p50001 VALUES LESS THAN (50001), + PARTITION p100001 VALUES LESS THAN (100001), + PARTITION p150001 VALUES LESS THAN (150001), + PARTITION p200001 VALUES LESS THAN (200001), + PARTITION p250001 VALUES LESS THAN (250001)); +create index aii on partition_none(a9) local; +SELECT a1, a9 FROM /*TaRgET*/ partition_none WHERE a5='ata l' AND 6793839=a2 AND a2=6159730 AND a9='da' ORDER BY a1, a9; + a1 | a9 +----+---- +(0 rows) + +drop table partition_none; ---- --- case 9: index scan with partition number be zero ---- @@ -726,9 +598,9 @@ PARTITION BY RANGE(c_date_1) ( PARTITION COMPRESS_TABLE_INTEVAL_1 VALUES LESS THAN('2012-8-23') ); -CREATE INDEX INDEX_COMPRESS_1 ON COMPRESS_TABLE_INDEX using btree(C_INT_2) LOCAL; -CREATE INDEX INDEX_COMPRESS_2 ON COMPRESS_TABLE_INDEX using btree(C_DATE_1) LOCAL; -CREATE INDEX INDEX_COMPRESS_3 ON COMPRESS_TABLE_INDEX using btree(C_INT_1) LOCAL; +CREATE INDEX INDEX_COMPRESS_1 ON COMPRESS_TABLE_INDEX(C_INT_2) LOCAL; +CREATE INDEX INDEX_COMPRESS_2 ON COMPRESS_TABLE_INDEX(C_DATE_1) LOCAL; +CREATE INDEX INDEX_COMPRESS_3 ON COMPRESS_TABLE_INDEX(C_INT_1) LOCAL; SELECT COUNT(*) FROM COMPRESS_TABLE_INDEX WHERE C_DATE_1>='2012-09-01' AND C_DATE_1<'2012-9-20'; count ------- @@ -736,93 +608,3 @@ SELECT COUNT(*) FROM COMPRESS_TABLE_INDEX WHERE C_DATE_1>='2012-09-01' AND C_DAT (1 row) drop table COMPRESS_TABLE_INDEX; ----- ---- case 10:index scan with qual push down ----- -set datestyle to iso; -SET IntervalStyle to postgres; -set time zone PRC; -CREATE TABLE PARTITION_SELECT_PICT_TABLE( -C_CHAR_3 CHAR(102400), -C_VARCHAR_3 VARCHAR(1024), -C_INT INTEGER, -C_NUMERIC numeric(10,5), -C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) -DISTRIBUTE BY HASH(C_CHAR_3) -partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) -( - partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), - partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), - partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') -); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',111,111.1,'2000-01-01 01:01:01'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',222,222.2,'2000-02-02 02:02:02'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,333.3,'2000-03-03 03:03:03'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('DEFGHIJ','defghij',444,444.4,'2000-04-04 04:04:04'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK','efghijk',555,555.5,'2000-05-05 05:05:05'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',666,666.6,'2000-06-06 06:06:06'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,111,111.1,'2000-01-01 01:01:01'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,null,null,null); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',null,111.1,'2000-01-01 01:01:01'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',null,null,'2000-02-02 02:02:02'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH',null,222,null,'2000-02-02 02:02:02'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,null,'2000-03-03 03:03:03'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK',null,null,555.5,'2000-05-05 05:05:05'); -INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',null,null,null); -insert into PARTITION_SELECT_PICT_TABLE VALUES('A'||generate_series(1,5),'a'||generate_series(1,5),generate_series(1,5),cast( generate_series(1,5)||'.111' as numeric(10,5)),cast('2000-01-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('B'||generate_series(101,103),'b'||generate_series(101,103),generate_series(101,103),cast(generate_series(101,103)||'.111' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('C'||generate_series(201,205),'c'||generate_series(201,205),generate_series(201,205),cast(generate_series(201,205)||'.111' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('D'||generate_series(301,303),'d'||generate_series(301,303),generate_series(301,303),cast(generate_series(301,303)||'.111' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('DE'||generate_series(401,405),'de'||generate_series(401,405),generate_series(401,405),cast(generate_series(401,405)||'.111' as numeric(10,5)),cast('2000-05-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('E'||generate_series(501,504),'e'||generate_series(501,504),generate_series(501,504),cast( generate_series(501,504)||'.222' as numeric(10,5)),cast('2000-01-'||generate_series(1,4)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('F'||generate_series(601,603),'f'||generate_series(601,603),generate_series(601,603),cast(generate_series(601,603)||'.222' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('G'||generate_series(701,705),'g'||generate_series(701,705),generate_series(701,705),cast(generate_series(701,705)||'.222' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -insert into PARTITION_SELECT_PICT_TABLE VALUES('GH'||generate_series(801,803),'gh'||generate_series(801,803),generate_series(801,803),cast(generate_series(801,803)||'.222' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); -CREATE TABLE VECTOR_PARTITION_SELECT_PICT_TABLE( -C_CHAR_3 CHAR(102400), -C_VARCHAR_3 VARCHAR(1024), -C_INT INTEGER, -C_NUMERIC numeric(10,5), -C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) with (orientation = column) -DISTRIBUTE BY HASH(C_CHAR_3) -partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) -( - partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), - partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), - partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') -); -insert into VECTOR_PARTITION_SELECT_PICT_TABLE select * from PARTITION_SELECT_PICT_TABLE; -create index PARTITION_SELECT_PICT_INDEX_1 ON VECTOR_PARTITION_SELECT_PICT_TABLE using btree(C_CHAR_3,C_VARCHAR_3,C_INT,C_NUMERIC,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); -create index PARTITION_SELECT_PICT_INDEX_2 ON VECTOR_PARTITION_SELECT_PICT_TABLE using btree(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); -create index PARTITION_SELECT_PICT_INDEX_3 ON VECTOR_PARTITION_SELECT_PICT_TABLE using btree(C_CHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); -SELECT trim(C_CHAR_3) , trim(C_VARCHAR_3) , C_INT , C_NUMERIC , C_TS_WITHOUT , lower(trim(C_CHAR_3)) , initcap(trim(C_VARCHAR_3)) , abs(C_INT) , abs(C_NUMERIC) , extract(year from C_TS_WITHOUT) FROM VECTOR_PARTITION_SELECT_PICT_TABLE partition(PARTITION_SELECT_PICT_1) where 'a' not like C_VARCHAR_3 and 1000 != C_INT and C_NUMERIC is not null and (C_TS_WITHOUT >= '2000-01-01 01:01:01' and C_TS_WITHOUT <= '2000-09-09 09:09:09') ORDER BY 1 , 2 , 3 , 4 , 5 ; - btrim | btrim | c_int | c_numeric | c_ts_without | lower | initcap | abs | abs | date_part ----------+---------+-------+-----------+---------------------+---------+---------+-----+-----------+----------- - A1 | a1 | 1 | 1.11100 | 2000-01-01 12:12:12 | a1 | A1 | 1 | 1.11100 | 2000 - A2 | a2 | 2 | 2.11100 | 2000-01-02 12:12:12 | a2 | A2 | 2 | 2.11100 | 2000 - A3 | a3 | 3 | 3.11100 | 2000-01-03 12:12:12 | a3 | A3 | 3 | 3.11100 | 2000 - A4 | a4 | 4 | 4.11100 | 2000-01-04 12:12:12 | a4 | A4 | 4 | 4.11100 | 2000 - A5 | a5 | 5 | 5.11100 | 2000-01-05 12:12:12 | a5 | A5 | 5 | 5.11100 | 2000 - ABCDEFG | abcdefg | 111 | 111.10000 | 2000-01-01 01:01:01 | abcdefg | Abcdefg | 111 | 111.10000 | 2000 - B101 | b101 | 101 | 101.11100 | 2000-02-01 12:12:12 | b101 | B101 | 101 | 101.11100 | 2000 - B102 | b102 | 102 | 102.11100 | 2000-02-02 12:12:12 | b102 | B102 | 102 | 102.11100 | 2000 - B103 | b103 | 103 | 103.11100 | 2000-02-03 12:12:12 | b103 | B103 | 103 | 103.11100 | 2000 - BCDEFGH | bcdefgh | 222 | 222.20000 | 2000-02-02 02:02:02 | bcdefgh | Bcdefgh | 222 | 222.20000 | 2000 - C201 | c201 | 201 | 201.11100 | 2000-03-01 12:12:12 | c201 | C201 | 201 | 201.11100 | 2000 - C202 | c202 | 202 | 202.11100 | 2000-03-02 12:12:12 | c202 | C202 | 202 | 202.11100 | 2000 - C203 | c203 | 203 | 203.11100 | 2000-03-03 12:12:12 | c203 | C203 | 203 | 203.11100 | 2000 - C204 | c204 | 204 | 204.11100 | 2000-03-04 12:12:12 | c204 | C204 | 204 | 204.11100 | 2000 - C205 | c205 | 205 | 205.11100 | 2000-03-05 12:12:12 | c205 | C205 | 205 | 205.11100 | 2000 - CDEFGHI | cdefghi | 333 | 333.30000 | 2000-03-03 03:03:03 | cdefghi | Cdefghi | 333 | 333.30000 | 2000 - D301 | d301 | 301 | 301.11100 | 2000-04-01 12:12:12 | d301 | D301 | 301 | 301.11100 | 2000 - D302 | d302 | 302 | 302.11100 | 2000-04-02 12:12:12 | d302 | D302 | 302 | 302.11100 | 2000 - D303 | d303 | 303 | 303.11100 | 2000-04-03 12:12:12 | d303 | D303 | 303 | 303.11100 | 2000 - DE401 | de401 | 401 | 401.11100 | 2000-05-01 12:12:12 | de401 | De401 | 401 | 401.11100 | 2000 - DE402 | de402 | 402 | 402.11100 | 2000-05-02 12:12:12 | de402 | De402 | 402 | 402.11100 | 2000 - DE403 | de403 | 403 | 403.11100 | 2000-05-03 12:12:12 | de403 | De403 | 403 | 403.11100 | 2000 - DE404 | de404 | 404 | 404.11100 | 2000-05-04 12:12:12 | de404 | De404 | 404 | 404.11100 | 2000 - DE405 | de405 | 405 | 405.11100 | 2000-05-05 12:12:12 | de405 | De405 | 405 | 405.11100 | 2000 -(24 rows) - -drop table PARTITION_SELECT_PICT_TABLE; -drop table VECTOR_PARTITION_SELECT_PICT_TABLE; diff --git a/src/test/regress/output/hw_cstore_btree_index2.source b/src/test/regress/output/hw_cstore_btree_index2.source index b7ff8b45a..d5f14e6f9 100644 --- a/src/test/regress/output/hw_cstore_btree_index2.source +++ b/src/test/regress/output/hw_cstore_btree_index2.source @@ -1,62 +1,155 @@ -create schema cstore_btree_index2; -set current_schema = cstore_btree_index2; ---- ---case 3: check reserve column +--- case 10:index scan with qual push down ---- -CREATE TABLE check_column(id int, tid int); -ERROR: column name "tid" conflicts with a system column name -CREATE TABLE check_column(id int); -ALTER TABLE check_column ADD COLUMN tid int; -ERROR: column name "tid" conflicts with a system column name -CREATE TABLE row_tbl_for_gin_idx(c_id tsvector ,c_d_id tsvector) DISTRIBUTE BY REPLICATION; +set datestyle to iso; +SET IntervalStyle to postgres; +set time zone PRC; +CREATE TABLE PARTITION_SELECT_PICT_TABLE( +C_CHAR_3 CHAR(102400), +C_VARCHAR_3 VARCHAR(1024), +C_INT INTEGER, +C_NUMERIC numeric(10,5), +C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) +partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) +( + partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), + partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), + partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') +); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',111,111.1,'2000-01-01 01:01:01'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',222,222.2,'2000-02-02 02:02:02'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,333.3,'2000-03-03 03:03:03'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('DEFGHIJ','defghij',444,444.4,'2000-04-04 04:04:04'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK','efghijk',555,555.5,'2000-05-05 05:05:05'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',666,666.6,'2000-06-06 06:06:06'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,111,111.1,'2000-01-01 01:01:01'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG',null,null,null,null); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('ABCDEFG','abcdefg',null,111.1,'2000-01-01 01:01:01'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH','bcdefgh',null,null,'2000-02-02 02:02:02'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('BCDEFGH',null,222,null,'2000-02-02 02:02:02'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('CDEFGHI','cdefghi',333,null,'2000-03-03 03:03:03'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('EFGHIJK',null,null,555.5,'2000-05-05 05:05:05'); +INSERT INTO PARTITION_SELECT_PICT_TABLE VALUES('FGHIJKL','fghijkl',null,null,null); +insert into PARTITION_SELECT_PICT_TABLE VALUES('A'||generate_series(1,5),'a'||generate_series(1,5),generate_series(1,5),cast( generate_series(1,5)||'.111' as numeric(10,5)),cast('2000-01-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('B'||generate_series(101,103),'b'||generate_series(101,103),generate_series(101,103),cast(generate_series(101,103)||'.111' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('C'||generate_series(201,205),'c'||generate_series(201,205),generate_series(201,205),cast(generate_series(201,205)||'.111' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('D'||generate_series(301,303),'d'||generate_series(301,303),generate_series(301,303),cast(generate_series(301,303)||'.111' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('DE'||generate_series(401,405),'de'||generate_series(401,405),generate_series(401,405),cast(generate_series(401,405)||'.111' as numeric(10,5)),cast('2000-05-'||generate_series(1,5)||' 12:12:12' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('E'||generate_series(501,504),'e'||generate_series(501,504),generate_series(501,504),cast( generate_series(501,504)||'.222' as numeric(10,5)),cast('2000-01-'||generate_series(1,4)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('F'||generate_series(601,603),'f'||generate_series(601,603),generate_series(601,603),cast(generate_series(601,603)||'.222' as numeric(10,5)),cast('2000-02-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('G'||generate_series(701,705),'g'||generate_series(701,705),generate_series(701,705),cast(generate_series(701,705)||'.222' as numeric(10,5)),cast('2000-03-'||generate_series(1,5)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +insert into PARTITION_SELECT_PICT_TABLE VALUES('GH'||generate_series(801,803),'gh'||generate_series(801,803),generate_series(801,803),cast(generate_series(801,803)||'.222' as numeric(10,5)),cast('2000-04-'||generate_series(1,3)||' 13:13:13' as TIMESTAMP WITHOUT TIME ZONE)); +CREATE TABLE VECTOR_PARTITION_SELECT_PICT_TABLE( +C_CHAR_3 CHAR(102400), +C_VARCHAR_3 VARCHAR(1024), +C_INT INTEGER, +C_NUMERIC numeric(10,5), +C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE) with (orientation = column) + +partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) +( + partition PARTITION_SELECT_PICT_1 values less than ('DEFGHIJ', 'defghij', 444, '2000-04-04 04:04:04'), + partition PARTITION_SELECT_PICT_2 values less than ('GHIJKLM', 'ghijklm', 777, '2000-07-07 07:07:07'), + partition PARTITION_SELECT_PICT_3 values less than ('MJKLMNO', 'ijklmno', 999, '2000-09-09 09:09:09') +); +insert into VECTOR_PARTITION_SELECT_PICT_TABLE select * from PARTITION_SELECT_PICT_TABLE; +create index PARTITION_SELECT_PICT_INDEX_1 ON VECTOR_PARTITION_SELECT_PICT_TABLE(C_CHAR_3,C_VARCHAR_3,C_INT,C_NUMERIC,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); +create index PARTITION_SELECT_PICT_INDEX_2 ON VECTOR_PARTITION_SELECT_PICT_TABLE(C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); +create index PARTITION_SELECT_PICT_INDEX_3 ON VECTOR_PARTITION_SELECT_PICT_TABLE(C_CHAR_3,C_INT,C_TS_WITHOUT) local(PARTITION PARTITION_SELECT_PICT_1, PARTITION PARTITION_SELECT_PICT_2, PARTITION PARTITION_SELECT_PICT_3); +SELECT trim(C_CHAR_3) , trim(C_VARCHAR_3) , C_INT , C_NUMERIC , C_TS_WITHOUT , lower(trim(C_CHAR_3)) , initcap(trim(C_VARCHAR_3)) , abs(C_INT) , abs(C_NUMERIC) , extract(year from C_TS_WITHOUT) FROM VECTOR_PARTITION_SELECT_PICT_TABLE partition(PARTITION_SELECT_PICT_1) where 'a' not like C_VARCHAR_3 and 1000 != C_INT and C_NUMERIC is not null and (C_TS_WITHOUT >= '2000-01-01 01:01:01' and C_TS_WITHOUT <= '2000-09-09 09:09:09') ORDER BY 1 , 2 , 3 , 4 , 5 ; + btrim | btrim | c_int | c_numeric | c_ts_without | lower | initcap | abs | abs | date_part +---------+---------+-------+-----------+---------------------+---------+---------+-----+-----------+----------- + A1 | a1 | 1 | 1.11100 | 2000-01-01 12:12:12 | a1 | A1 | 1 | 1.11100 | 2000 + A2 | a2 | 2 | 2.11100 | 2000-01-02 12:12:12 | a2 | A2 | 2 | 2.11100 | 2000 + A3 | a3 | 3 | 3.11100 | 2000-01-03 12:12:12 | a3 | A3 | 3 | 3.11100 | 2000 + A4 | a4 | 4 | 4.11100 | 2000-01-04 12:12:12 | a4 | A4 | 4 | 4.11100 | 2000 + A5 | a5 | 5 | 5.11100 | 2000-01-05 12:12:12 | a5 | A5 | 5 | 5.11100 | 2000 + ABCDEFG | abcdefg | 111 | 111.10000 | 2000-01-01 01:01:01 | abcdefg | Abcdefg | 111 | 111.10000 | 2000 + B101 | b101 | 101 | 101.11100 | 2000-02-01 12:12:12 | b101 | B101 | 101 | 101.11100 | 2000 + B102 | b102 | 102 | 102.11100 | 2000-02-02 12:12:12 | b102 | B102 | 102 | 102.11100 | 2000 + B103 | b103 | 103 | 103.11100 | 2000-02-03 12:12:12 | b103 | B103 | 103 | 103.11100 | 2000 + BCDEFGH | bcdefgh | 222 | 222.20000 | 2000-02-02 02:02:02 | bcdefgh | Bcdefgh | 222 | 222.20000 | 2000 + C201 | c201 | 201 | 201.11100 | 2000-03-01 12:12:12 | c201 | C201 | 201 | 201.11100 | 2000 + C202 | c202 | 202 | 202.11100 | 2000-03-02 12:12:12 | c202 | C202 | 202 | 202.11100 | 2000 + C203 | c203 | 203 | 203.11100 | 2000-03-03 12:12:12 | c203 | C203 | 203 | 203.11100 | 2000 + C204 | c204 | 204 | 204.11100 | 2000-03-04 12:12:12 | c204 | C204 | 204 | 204.11100 | 2000 + C205 | c205 | 205 | 205.11100 | 2000-03-05 12:12:12 | c205 | C205 | 205 | 205.11100 | 2000 + CDEFGHI | cdefghi | 333 | 333.30000 | 2000-03-03 03:03:03 | cdefghi | Cdefghi | 333 | 333.30000 | 2000 + D301 | d301 | 301 | 301.11100 | 2000-04-01 12:12:12 | d301 | D301 | 301 | 301.11100 | 2000 + D302 | d302 | 302 | 302.11100 | 2000-04-02 12:12:12 | d302 | D302 | 302 | 302.11100 | 2000 + D303 | d303 | 303 | 303.11100 | 2000-04-03 12:12:12 | d303 | D303 | 303 | 303.11100 | 2000 + DE401 | de401 | 401 | 401.11100 | 2000-05-01 12:12:12 | de401 | De401 | 401 | 401.11100 | 2000 + DE402 | de402 | 402 | 402.11100 | 2000-05-02 12:12:12 | de402 | De402 | 402 | 402.11100 | 2000 + DE403 | de403 | 403 | 403.11100 | 2000-05-03 12:12:12 | de403 | De403 | 403 | 403.11100 | 2000 + DE404 | de404 | 404 | 404.11100 | 2000-05-04 12:12:12 | de404 | De404 | 404 | 404.11100 | 2000 + DE405 | de405 | 405 | 405.11100 | 2000-05-05 12:12:12 | de405 | De405 | 405 | 405.11100 | 2000 +(24 rows) + +drop table PARTITION_SELECT_PICT_TABLE; +drop table VECTOR_PARTITION_SELECT_PICT_TABLE; +CREATE TABLE row_tbl_for_gin_idx(c_id tsvector ,c_d_id tsvector) ; CREATE INDEX ginidx_for_rowtbl ON row_tbl_for_gin_idx USING GIN(c_id,c_d_id) WITH (FASTUPDATE = OFF); -- test storage parameters for index normal-relation CREATE TABLE heaptbl_idxstorage ( a int, b int , c int ) with ( orientation = column ); -CREATE INDEX idx00_heaptbl_idxstorage ON heaptbl_idxstorage using btree(b) with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); +CREATE INDEX idx00_heaptbl_idxstorage ON heaptbl_idxstorage(b) with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); SELECT relam, relkind, reloptions FROM pg_class WHERE relname = 'idx00_heaptbl_idxstorage'; relam | relkind | reloptions -------+---------+-------------------------------------------------------------------------- - 4039 | i | {max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} - 4239 | i | {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000} -(2 rows) + 4039 | i | {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000} +(1 row) SELECT reloptions FROM pg_class WHERE oid = (SELECT relcudescrelid FROM pg_class WHERE relname = 'idx00_heaptbl_idxstorage'); -ERROR: more than one row returned by a subquery used as an expression + reloptions +----------------------------------------------------------------------------------------------------------------- + {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000,orientation=column,internal_mask=33031} +(1 row) + ALTER INDEX idx00_heaptbl_idxstorage SET (max_batchrow = 40000, partial_cluster_rows = 920000, deltarow_threshold = 4000 ); SELECT relam, relkind, reloptions FROM pg_class WHERE relname = 'idx00_heaptbl_idxstorage'; relam | relkind | reloptions -------+---------+-------------------------------------------------------------------------- 4039 | i | {max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} - 4239 | i | {max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} -(2 rows) +(1 row) SELECT reloptions FROM pg_class WHERE oid = (SELECT relcudescrelid FROM pg_class WHERE relname = 'idx00_heaptbl_idxstorage'); -ERROR: more than one row returned by a subquery used as an expression + reloptions +----------------------------------------------------------------------------------------------------------------- + {orientation=column,internal_mask=33031,max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} +(1 row) + -- test storage parameters for index partition-relation CREATE TABLE parttbl_idxstorage ( a int, b int , c int ) with ( orientation = column ) partition by range(b) (partition p1 values less than (10), partition p2 values less than (100)); -CREATE INDEX idx00_parttbl_idxstorage ON parttbl_idxstorage using btree(c) local with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); +CREATE INDEX idx00_parttbl_idxstorage ON parttbl_idxstorage(c) local with (max_batchrow = 20000, partial_cluster_rows = 720000, deltarow_threshold = 2000 ); SELECT relam, relkind, reloptions FROM pg_class WHERE relname = 'idx00_parttbl_idxstorage'; relam | relkind | reloptions -------+---------+-------------------------------------------------------------------------- - 4039 | i | {max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} - 4239 | i | {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000} -(2 rows) + 4039 | i | {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000} +(1 row) SELECT reloptions FROM pg_class WHERE oid in ( SELECT relcudescrelid from pg_partition where parentid = (SELECT oid FROM pg_class WHERE relname = 'idx00_parttbl_idxstorage') ); -ERROR: more than one row returned by a subquery used as an expression + reloptions +----------------------------------------------------------------------------------------------------------------- + {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000,orientation=column,internal_mask=33031} + {max_batchrow=20000,partial_cluster_rows=720000,deltarow_threshold=2000,orientation=column,internal_mask=33031} +(2 rows) + ALTER INDEX idx00_parttbl_idxstorage SET (max_batchrow = 40000, partial_cluster_rows = 920000, deltarow_threshold = 4000 ); SELECT relam, relkind, reloptions FROM pg_class WHERE relname = 'idx00_parttbl_idxstorage'; relam | relkind | reloptions -------+---------+-------------------------------------------------------------------------- 4039 | i | {max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} - 4239 | i | {max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} -(2 rows) +(1 row) SELECT reloptions FROM pg_class WHERE oid in ( SELECT relcudescrelid from pg_partition where parentid = (SELECT oid FROM pg_class WHERE relname = 'idx00_parttbl_idxstorage') ); -ERROR: more than one row returned by a subquery used as an expression + reloptions +----------------------------------------------------------------------------------------------------------------- + {orientation=column,internal_mask=33031,max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} + {orientation=column,internal_mask=33031,max_batchrow=40000,partial_cluster_rows=920000,deltarow_threshold=4000} +(2 rows) + -- test: fill vector batch by switching to different CUs CREATE TABLE coltbl ( a int, b int ) WITH ( ORIENTATION = COLUMN ); CREATE TABLE rowtbl ( a int, b int ); @@ -68,8 +161,8 @@ INSERT INTO coltbl SELECT * FROM rowtbl; TRUNCATE TABLE rowtbl; INSERT INTO rowtbl VALUES ( 1, 5) , (1, 6); INSERT INTO coltbl SELECT * FROM rowtbl; -CREATE INDEX idx_coltbl ON coltbl using btree(b); -SELECT * FROM coltbl WHERE b < 6 order by 1, 2; +CREATE INDEX idx_coltbl ON coltbl(b); +SELECT * FROM coltbl WHERE b < 6 order by b; a | b ---+--- 1 | 1 @@ -83,8 +176,8 @@ DROP TABLE coltbl; DROP TABLE rowtbl; -- index scan: constant target list create table test_index_const_targetlist (id int,info int,info1 int) with(orientation=column); -create index idx1_test_index_const_targetlist on test_index_const_targetlist using btree(info); -create index idx2_test_index_const_targetlist on test_index_const_targetlist using btree(info1); +create index idx1_test_index_const_targetlist on test_index_const_targetlist(info); +create index idx2_test_index_const_targetlist on test_index_const_targetlist(info1); insert into test_index_const_targetlist values(generate_series(1,10),generate_series(1,10), 1); update test_index_const_targetlist set info=info+1 where info>5; select 1 from test_index_const_targetlist where info1=1 ; @@ -125,7 +218,7 @@ create table psort_schema.psort_base_tab ( col_timetz time with time zone, col_interval interval, col_smalldatetine smalldatetime,partial cluster key(col_timestamp) -) with (orientation=column) distribute by hash(col_int) +) with (orientation=column) partition by range (col_int) ( partition vector_base_tab_000_1 values less than (10), @@ -188,7 +281,7 @@ create table psort_base_tab ( col_timetz time with time zone, col_interval interval, col_smalldatetine smalldatetime,partial cluster key(col_timestamp) -) with (orientation=column) distribute by hash(col_int) +) with (orientation=column) partition by range (col_int) ( partition vector_base_tab_000_1 values less than (10), @@ -231,14 +324,14 @@ partition vector_base_tab_000_37 values less than (3887), partition vector_base_tab_000_38 values less than (3987), partition vector_base_tab_000_39 values less than (maxvalue) ); -create index psort_base_tab_index_0001 on psort_schema.psort_base_tab using btree(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; -create index psort_base_tab_index_0001 on psort_base_tab using btree(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; +create index psort_base_tab_index_0001 on psort_schema.psort_base_tab(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; +create index psort_base_tab_index_0001 on psort_base_tab(col_smallint,col_int,col_char,col_text,col_timestamp,col_date) local; drop table psort_schema.psort_base_tab; drop table psort_base_tab; ---- -- create index in tablespace ---- -create table psort_schema.cstore_col_part (id int, cu int, num int, num1 int) with (orientation = column) distribute by hash(id) +create table psort_schema.cstore_col_part (id int, cu int, num int, num1 int) with (orientation = column) partition by range (num1) ( partition p1 values less than (1000), @@ -248,22 +341,19 @@ partition by range (num1) partition p5 values less than (5000), partition p6 values less than (maxvalue) ); -create table psort_schema.cstore_row (id int, cu int, num int, num1 int) distribute by hash(id); +create table psort_schema.cstore_row (id int, cu int, num int, num1 int) ; insert into psort_schema.cstore_row values(1, 1, generate_series(1, 5000), generate_series(1, 5000)); insert into psort_schema.cstore_col_part select * from psort_schema.cstore_row; -create tablespace psort_ts location '@testtablespace@/psort_ts' maxsize '256k'; -create index on psort_schema.cstore_col_part using btree(num) local tablespace psort_ts; -drop tablespace psort_ts; -ERROR: tablespace "psort_ts" is not empty -create tablespace psort_ts location '@testtablespace@/psort_ts'; -ERROR: tablespace "psort_ts" already exists -start transaction; -create index on psort_schema.cstore_col_part using btree(num) local tablespace psort_ts; +create tablespace psort_ts location '/usr3/data1/jiangyan/openGauss-server/src/test/regress/testtablespace/psort_ts' maxsize '256k'; +create index on psort_schema.cstore_col_part(num) local tablespace psort_ts; ERROR: Insufficient storage space for tablespace "psort_ts" -HINT: Limited size is 262144, current size is 253952, request size is 16384 +HINT: Limited size is 262144, current size is 270336, request size is 8192 +drop tablespace psort_ts; +create tablespace psort_ts location '/usr3/data1/jiangyan/openGauss-server/src/test/regress/testtablespace/psort_ts'; +start transaction; +create index on psort_schema.cstore_col_part(num) local tablespace psort_ts; rollback; drop tablespace psort_ts; -ERROR: tablespace "psort_ts" is not empty drop table psort_schema.cstore_col_part; ---- -- CStoreIndexScan and output XMIN @@ -272,14 +362,14 @@ insert into psort_schema.cstore_row values(1, 2, generate_series(1, 5000), gener insert into psort_schema.cstore_row values(1, 3, generate_series(1, 5000), generate_series(1, 5000)); insert into psort_schema.cstore_row values(1, 4, generate_series(1, 5000), generate_series(1, 5000)); insert into psort_schema.cstore_row values(1, 5, generate_series(1, 5000), generate_series(1, 5000)); -create table psort_schema.cstore_col (id int, cu int, num int, num1 int) with (orientation = column) distribute by hash(id); +create table psort_schema.cstore_col (id int, cu int, num int, num1 int) with (orientation = column) ; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 1; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 2; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 3; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 4; insert into psort_schema.cstore_col select * from psort_schema.cstore_row where cu = 5; -create index on psort_schema.cstore_col using btree(num); -create index on psort_schema.cstore_col using btree(num1); +create index on psort_schema.cstore_col(num); +create index on psort_schema.cstore_col(num1); analyze psort_schema.cstore_col; select count(xmin) from psort_schema.cstore_col where num = 100; count @@ -296,9 +386,3 @@ select count(xmin) from psort_schema.cstore_col where num = 200 and num1 = 200; drop table psort_schema.cstore_row; drop table psort_schema.cstore_col; DROP SCHEMA psort_schema CASCADE; -drop schema cstore_btree_index2 cascade; -NOTICE: drop cascades to 4 other objects -DETAIL: drop cascades to table check_column -drop cascades to table row_tbl_for_gin_idx -drop cascades to table heaptbl_idxstorage -drop cascades to table parttbl_idxstorage diff --git a/src/test/regress/output/hw_independent_user.source b/src/test/regress/output/hw_independent_user.source index 67e9349df..5ed5a82cb 100644 --- a/src/test/regress/output/hw_independent_user.source +++ b/src/test/regress/output/hw_independent_user.source @@ -41,42 +41,49 @@ alter user noindependent_user identified by 'gauss@789'; ERROR: Only independent user himself can alter his own password. grant independent_user to noindependent_user; ERROR: Only independent user himself can decide his own membership. -\! @abs_bindir@/gsql -d regression -U noindependent_user -W 'gauss@123' -p @portstring@ -c 'alter user noindependent_user with noindependent;' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U noindependent_user -W 'gauss@123' -p 25632 -c 'alter user noindependent_user with noindependent;' ALTER ROLE -\! @abs_bindir@/gsql -d regression -U independent_user -W 'gauss@123' -p @portstring@ -c 'create table independent_tbl(id1 int,id2 int);insert into independent_tbl values(100,100);insert into independent_tbl values(300,300);' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U independent_user -W 'gauss@123' -p 25632 -c 'create table independent_tbl(id1 int,id2 int);insert into independent_tbl values(100,100);insert into independent_tbl values(300,300);' CREATE TABLE INSERT 0 1 INSERT 0 1 -\! @abs_bindir@/gsql -d regression -U independent_user -W 'gauss@123' -p @portstring@ -c 'create view independent_user.myview as select * from independent_user.independent_tbl;' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U independent_user -W 'gauss@123' -p 25632 -c 'create view independent_user.myview as select * from independent_user.independent_tbl;' CREATE VIEW -\! @abs_bindir@/gsql -d regression -U noindependent_user -W 'gauss@123' -p @portstring@ -c 'create table noindependent_tbl(id1 int,id2 int);insert into noindependent_tbl values(100,100);insert into noindependent_tbl values(300,300);' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U noindependent_user -W 'gauss@123' -p 25632 -c 'create table noindependent_tbl(id1 int,id2 int);insert into noindependent_tbl values(100,100);insert into noindependent_tbl values(300,300);' CREATE TABLE INSERT 0 1 INSERT 0 1 -\! @abs_bindir@/gsql -d regression -U noindependent_user -W 'gauss@123' -p @portstring@ -c 'create view noindependent_user.myview as select * from noindependent_user.noindependent_tbl;' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U noindependent_user -W 'gauss@123' -p 25632 -c 'create view noindependent_user.myview as select * from noindependent_user.noindependent_tbl;' CREATE VIEW --independent insert into independent_user.independent_tbl values(100,100); ERROR: permission denied for relation independent_tbl +DETAIL: N/A delete from independent_user.independent_tbl where id1=100; ERROR: permission denied for relation independent_tbl +DETAIL: N/A update independent_user.independent_tbl set id2=500 where id1=300; ERROR: permission denied for relation independent_tbl +DETAIL: N/A select * from independent_user.independent_tbl; ERROR: permission denied for relation independent_tbl +DETAIL: N/A grant select on independent_user.independent_tbl to sysuser; -ERROR: permission denied for relation independent_tbl +ERROR: no privileges were granted for "independent_tbl" revoke select on independent_user.independent_tbl from sysuser; -ERROR: permission denied for relation independent_tbl +ERROR: no privileges could be revoked for "independent_tbl" copy independent_user.independent_tbl to STDOUT; ERROR: permission denied for relation independent_tbl +DETAIL: N/A alter table independent_user.independent_tbl owner to sysuser; ERROR: must be owner of relation independent_tbl +DETAIL: N/A truncate independent_user.independent_tbl; vacuum independent_user.independent_tbl; analyze independent_user.independent_tbl; select * from independent_user.myview; ERROR: permission denied for relation myview +DETAIL: N/A select has_table_privilege('independent_user.independent_tbl','select'); has_table_privilege --------------------- @@ -137,6 +144,7 @@ alter table noindependent_user.noindependent_tbl owner to sysuser; truncate noindependent_user.noindependent_tbl; select * from noindependent_user.myview; ERROR: permission denied for relation noindependent_tbl +DETAIL: N/A select has_table_privilege('noindependent_user.noindependent_tbl','select'); has_table_privilege --------------------- @@ -183,18 +191,22 @@ select has_table_privilege('noindependent_user.noindependent_tbl','trigger'); create table independent_user.like_independent_tbl(like independent_user.independent_tbl); create table independent_user.temp_create_tbl as select * from independent_user.independent_tbl; ERROR: permission denied for relation temp_create_tbl +DETAIL: N/A select * into independent_user.temp_create_tbl from independent_user.independent_tbl; ERROR: permission denied for relation temp_create_tbl +DETAIL: N/A create table public.temp_create_tbl as select * from independent_user.independent_tbl; ERROR: permission denied for relation independent_tbl +DETAIL: N/A select * into public.temp_create_tbl from independent_user.independent_tbl; ERROR: permission denied for relation independent_tbl +DETAIL: N/A create index indep_idx on independent_user.independent_tbl(id2); drop index independent_user.indep_idx; --test disable password for independent -\! @abs_bindir@/gsql -d regression -U independent_user -W 'gauss@123' -p @portstring@ -c 'alter user independent_user password disable;' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U independent_user -W 'gauss@123' -p 25632 -c 'alter user independent_user password disable;' ALTER ROLE -\! @abs_bindir@/gsql -d regression -U noindependent_user -W 'gauss@123' -p @portstring@ -c 'alter user noindependent_user password disable;' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d regression -U noindependent_user -W 'gauss@123' -p 25632 -c 'alter user noindependent_user password disable;' ERROR: Only system admin can disable user's password. alter user independent_user password disable; ERROR: Only independent user himself can disable his own password. diff --git a/src/test/regress/output/hw_partition_merge2.source b/src/test/regress/output/hw_partition_merge2.source index 33b23bc03..468fb2d80 100644 --- a/src/test/regress/output/hw_partition_merge2.source +++ b/src/test/regress/output/hw_partition_merge2.source @@ -71,7 +71,6 @@ create index idx1_test_merge_index on test_merge_index_test(c1) local; create index idx2_test_merge_index on test_merge_index_test(c1, c2) local; create index idx3_test_merge_index on test_merge_index_test(c1, c2, c3) local; create index idx4_test_merge_index on test_merge_index_test using hash (c1) local; -ERROR: access method "hash" does not support row store --4.1 merge 2 partitions into one alter table test_merge_index_test merge partitions test_merge_index_test_p1, test_merge_index_test_p2 @@ -81,18 +80,16 @@ SET enable_seqscan = ON; SET enable_indexscan = OFF; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: c1 + -> Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -398,18 +395,16 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -715,18 +710,16 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 29 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partition Iterator + Iterations: 29 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -1037,18 +1030,16 @@ SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 29 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +----------------------------------------------------------------------------------------- + Sort + Sort Key: c1 + -> Partition Iterator + Iterations: 29 + -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -1354,18 +1345,16 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 29 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +----------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partition Iterator + Iterations: 29 + -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -1671,18 +1660,16 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 29 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +----------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partition Iterator + Iterations: 29 + -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -1993,18 +1980,16 @@ SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_indexonlyscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ----------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 29 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Sort + Sort Key: c1 + -> Partition Iterator + Iterations: 29 + -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -2310,18 +2295,16 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ----------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 29 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partition Iterator + Iterations: 29 + -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -2627,18 +2610,16 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ----------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 29 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..29 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partition Iterator + Iterations: 29 + -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..29 +(6 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -2953,18 +2934,16 @@ SET enable_seqscan = ON; SET enable_indexscan = OFF; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 27 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: c1 + -> Partition Iterator + Iterations: 27 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -3270,18 +3249,16 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 27 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partition Iterator + Iterations: 27 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -3587,18 +3564,16 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 27 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +----------------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partition Iterator + Iterations: 27 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -3909,18 +3884,16 @@ SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 27 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +----------------------------------------------------------------------------------------- + Sort + Sort Key: c1 + -> Partition Iterator + Iterations: 27 + -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -4226,18 +4199,16 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 27 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +----------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partition Iterator + Iterations: 27 + -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -4543,18 +4514,16 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 27 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +----------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partition Iterator + Iterations: 27 + -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -4865,18 +4834,16 @@ SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_indexonlyscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ----------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 27 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Sort + Sort Key: c1 + -> Partition Iterator + Iterations: 27 + -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -5182,18 +5149,16 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ----------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 27 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partition Iterator + Iterations: 27 + -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -5499,18 +5464,16 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ----------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 27 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1..27 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +---------------------------------------------------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partition Iterator + Iterations: 27 + -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1..27 +(6 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -5851,18 +5814,14 @@ SET enable_seqscan = ON; SET enable_indexscan = OFF; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Sort - Sort Key: c1 - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +----------------------------------------------------- + Sort + Sort Key: c1 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1 +(4 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -6168,18 +6127,14 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Sort - Sort Key: c1, c2 - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +----------------------------------------------------- + Sort + Sort Key: c1, c2 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1 +(4 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -6485,18 +6440,14 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Sort - Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 1 - -> Partitioned Seq Scan on test_merge_index_test - Selected Partitions: 1 -(8 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +----------------------------------------------------- + Sort + Sort Key: c1, c2, c3 + -> Partitioned Seq Scan on test_merge_index_test + Selected Partitions: 1 +(4 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -6807,16 +6758,12 @@ SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_indexonlyscan = OFF; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1 -(6 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +----------------------------------------------------------------------------- + Partitioned Index Scan using idx2_test_merge_index on test_merge_index_test + Selected Partitions: 1 +(2 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -7122,16 +7069,12 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1 -(6 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +----------------------------------------------------------------------------- + Partitioned Index Scan using idx2_test_merge_index on test_merge_index_test + Selected Partitions: 1 +(2 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -7437,16 +7380,12 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1 -(6 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +----------------------------------------------------------------------------- + Partitioned Index Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1 +(2 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 @@ -7757,16 +7696,12 @@ SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_indexonlyscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1; - QUERY PLAN ----------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1 - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1 -(6 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1; + QUERY PLAN +---------------------------------------------------------------------------------- + Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1 +(2 rows) select * from test_merge_index_test order by c1; c1 | c2 | c3 @@ -8072,16 +8007,12 @@ select * from test_merge_index_test order by c1; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2; - QUERY PLAN ----------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1, c2 - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1 -(6 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2; + QUERY PLAN +---------------------------------------------------------------------------------- + Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1 +(2 rows) select * from test_merge_index_test order by c1, c2; c1 | c2 | c3 @@ -8387,16 +8318,12 @@ select * from test_merge_index_test order by c1, c2; 299 | 299 | 299 (299 rows) -EXPLAIN (COSTS OFF, NODES OFF) select * from test_merge_index_test order by c1, c2, c3; - QUERY PLAN ----------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: c1, c2, c3 - -> Partition Iterator - Iterations: 1 - -> Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test - Selected Partitions: 1 -(6 rows) +EXPLAIN (COSTS OFF) select * from test_merge_index_test order by c1, c2, c3; + QUERY PLAN +---------------------------------------------------------------------------------- + Partitioned Index Only Scan using idx3_test_merge_index on test_merge_index_test + Selected Partitions: 1 +(2 rows) select * from test_merge_index_test order by c1, c2, c3; c1 | c2 | c3 diff --git a/src/test/regress/output/hw_partition_sql_adapt0.source b/src/test/regress/output/hw_partition_sql_adapt0.source index 996e8aa3c..1ca59227b 100644 --- a/src/test/regress/output/hw_partition_sql_adapt0.source +++ b/src/test/regress/output/hw_partition_sql_adapt0.source @@ -214,7 +214,7 @@ alter table test_add_column_check add column c int check (c>=0); -- failed insert into test_add_column_check values (-1, -1, -1); ERROR: new row for relation "test_add_column_check" violates check constraint "test_add_column_check_c_check" -DETAIL: Failing row contains (-1, -1, -1). +DETAIL: N/A -- success insert into test_add_column_check values (1, 1, 1); select * from test_add_column_check order by 1, 2; @@ -268,11 +268,12 @@ insert into test_add_column_constraint values (0, 0); -- a. unique -- failed alter table test_add_column_constraint add column c1 int unique; -ERROR: unique index columns must contain the partition key and collation must be default collation +NOTICE: ALTER TABLE / ADD UNIQUE will create implicit index "test_add_column_constraint_c1_tableoid_key" for table "test_add_column_constraint" -- b. primary key -- failed alter table test_add_column_constraint add column c2 int primary key; -ERROR: unique index columns must contain the partition key and collation must be default collation +NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "test_add_column_constraint_pkey" for table "test_add_column_constraint" +ERROR: column "c2" contains null values -- c. references create table test (a int primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test" @@ -352,9 +353,9 @@ select * from temp_View order by 1,2; drop view temp_view; drop table test_add_column_view; -- 11. test partitioned table has tablespace -\! rm -fr '@testtablespace@/hw_partition_sql_adapt_ts1' -\! mkdir '@testtablespace@/hw_partition_sql_adapt_ts1' -create tablespace hw_partition_sql_adapt_ts1 location '@testtablespace@/hw_partition_sql_adapt_ts1'; +\! rm -fr '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +\! mkdir '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +create tablespace hw_partition_sql_adapt_ts1 location '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1'; -- a. partitioned table has tablespace create table test_add_column_tablespace (a int, b int) tablespace hw_partition_sql_adapt_ts1 @@ -659,9 +660,9 @@ ERROR: index "temp_index" does not exist -- success drop table test_drop_column_index; -- 5. test table has tablespace -\! rm -fr '@testtablespace@/hw_partition_sql_adapt_ts1' -\! mkdir '@testtablespace@/hw_partition_sql_adapt_ts1' -create tablespace hw_partition_sql_adapt_ts1 location '@testtablespace@/hw_partition_sql_adapt_ts1'; +\! rm -fr '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +\! mkdir '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +create tablespace hw_partition_sql_adapt_ts1 location '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1'; -- a. partitioned table has tablespace create table test_drop_column_tablespace (a int, b int, c int, d int) tablespace hw_partition_sql_adapt_ts1 diff --git a/src/test/regress/output/hw_partition_sql_adapt1.source b/src/test/regress/output/hw_partition_sql_adapt1.source index 24d1b06ae..3c537e6aa 100644 --- a/src/test/regress/output/hw_partition_sql_adapt1.source +++ b/src/test/regress/output/hw_partition_sql_adapt1.source @@ -1,7 +1,7 @@ -- 6. test table has tablespace -\! rm -fr '@testtablespace@/hw_partition_sql_adapt_ts1' -\! mkdir '@testtablespace@/hw_partition_sql_adapt_ts1' -create tablespace hw_partition_sql_adapt_ts1 location '@testtablespace@/hw_partition_sql_adapt_ts1'; +\! rm -fr '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +\! mkdir '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +create tablespace hw_partition_sql_adapt_ts1 location '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1'; -- a. partitioned table has tablespace create table test_modify_column_type_tablespace (a int, b int, c int, d int) tablespace hw_partition_sql_adapt_ts1 diff --git a/src/test/regress/output/hw_partition_sql_adapt2.source b/src/test/regress/output/hw_partition_sql_adapt2.source index 898f312ce..4f3f19e63 100644 --- a/src/test/regress/output/hw_partition_sql_adapt2.source +++ b/src/test/regress/output/hw_partition_sql_adapt2.source @@ -960,9 +960,9 @@ comment on column test_comment.a is 'a is a column of test_comment'; --------+---------+-----------+---------+--------------+------------------------------- a | integer | | plain | | a is a column of test_comment Indexes: - "test_comment_index" btree (a) LOCAL(PARTITION test_comment_p1_a_idx, PARTITION test_comment_p2_a_idx, PARTITION test_comment_p3_a_idx) TABLESPACE pg_default -Range partition by(a) -Number of partition: 3 (View pg_partition to check each partition range.) + "test_comment_index" btree (a) LOCAL TABLESPACE pg_default +Partition By RANGE(a) +Number of partitions: 3 (View pg_partition to check each partition range.) Has OIDs: no Options: orientation=row, compression=no @@ -1061,9 +1061,9 @@ drop user temp_user; drop table test_partition_foreign_key; ---------------------- -- test alter table set tablespace on ordinary table -\! rm -fr '@testtablespace@/hw_partition_sql_adapt_ts1' -\! mkdir '@testtablespace@/hw_partition_sql_adapt_ts1' -create tablespace hw_partition_sql_adapt_ts1 location '@testtablespace@/hw_partition_sql_adapt_ts1'; +\! rm -fr '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +\! mkdir '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1' +create tablespace hw_partition_sql_adapt_ts1 location '/data2/jiangyan/openGauss-server/src/test/regress/testtablespace/hw_partition_sql_adapt_ts1'; create table test_tablespace (a int) tablespace hw_partition_sql_adapt_ts1; select tablename, tablespace from pg_tables where tablename = 'test_tablespace'; tablename | tablespace diff --git a/src/test/regress/output/hw_partition_truncate0.source b/src/test/regress/output/hw_partition_truncate0.source index e4fcefb33..4825e1dd1 100644 --- a/src/test/regress/output/hw_partition_truncate0.source +++ b/src/test/regress/output/hw_partition_truncate0.source @@ -199,7 +199,7 @@ select count(*) from partition_truncate_table_0000; --50 rows rollback; select count(*) from partition_truncate_table_0000; -ERROR: relation "partition_truncate_table_0000" does not exist +ERROR: relation "partition_truncate_table_0000" does not exist on datanode1 LINE 1: select count(*) from partition_truncate_table_0000; ^ --can not find the partitioned table diff --git a/src/test/regress/output/hw_partition_truncate1.source b/src/test/regress/output/hw_partition_truncate1.source index e256d4961..825bcc892 100644 --- a/src/test/regress/output/hw_partition_truncate1.source +++ b/src/test/regress/output/hw_partition_truncate1.source @@ -331,7 +331,6 @@ create table partition_truncate_table2 c1 int references partition_truncate_table1(c1), c2 int ); -ERROR: REFERENCES constraint is not yet supported. --insert into partition_truncate_table1 values (1,200); --insert into partition_truncate_table1 values (2,200); --insert into partition_truncate_table2 values (2,200); @@ -347,7 +346,6 @@ ERROR: REFERENCES constraint is not yet supported. --select * from partition_truncate_table2; ----0 rows drop table if exists partition_truncate_table1,partition_truncate_table2; -NOTICE: table "partition_truncate_table2" does not exist, skipping create table partition_truncate_table1 ( c1 int unique, @@ -365,20 +363,17 @@ partition by range (c1) partition partition_truncate_table2_p1 values less than (100), partition partition_truncate_table2_p2 values less than (150) ); -ERROR: REFERENCES constraint is not yet supported. insert into partition_truncate_table1 values (1,200); insert into partition_truncate_table1 values (2,200); insert into partition_truncate_table2 values (2,200); -ERROR: relation "partition_truncate_table2" does not exist -LINE 1: insert into partition_truncate_table2 values (2,200); - ^ insert into partition_truncate_table2 values (2,200); -ERROR: relation "partition_truncate_table2" does not exist -LINE 1: insert into partition_truncate_table2 values (2,200); - ^ truncate table partition_truncate_table1 restrict; +ERROR: cannot truncate a table referenced in a foreign key constraint +DETAIL: Table "partition_truncate_table2" references "partition_truncate_table1". +HINT: Truncate table "partition_truncate_table2" at the same time, or use TRUNCATE ... CASCADE. --can't truncate table partition_truncate_table1 truncate table partition_truncate_table1 cascade ; +NOTICE: truncate cascades to table "partition_truncate_table2" select * from partition_truncate_table1 order by 1, 2; c1 | c2 ----+---- @@ -386,12 +381,12 @@ select * from partition_truncate_table1 order by 1, 2; --0 rows select * from partition_truncate_table2 order by 1, 2; -ERROR: relation "partition_truncate_table2" does not exist -LINE 1: select * from partition_truncate_table2 order by 1, 2; - ^ + c1 | c2 +----+---- +(0 rows) + --0 rows drop table if exists partition_truncate_table1,partition_truncate_table2; -NOTICE: table "partition_truncate_table2" does not exist, skipping --05-------------------------------------------------------------------- --cascade test --partitioned table has fk on a partitioned table @@ -446,6 +441,7 @@ revoke truncate on table partition_truncate_table from partition_truncate_user1; set session authorization partition_truncate_user1 password 'gauss@123'; truncate partition_truncate_table; ERROR: permission denied for relation partition_truncate_table +DETAIL: N/A --permission de reset session authorization; drop table partition_truncate_table; @@ -513,12 +509,15 @@ revoke truncate on table partition_truncate_user1.partition_truncate_table from set session authorization partition_truncate_user1 password 'gauss@123'; truncate partition_truncate_table; ERROR: permission denied for relation partition_truncate_table +DETAIL: N/A --fail , no permission alter table partition_truncate_table truncate partition partition_truncate_table_p0; ERROR: permission denied for relation partition_truncate_table +DETAIL: N/A --fail , no permission alter table partition_truncate_table truncate partition for (0); ERROR: permission denied for relation partition_truncate_table +DETAIL: N/A --fail , no permission drop table partition_truncate_table; reset session authorization; @@ -625,7 +624,7 @@ select count(*) from partition_truncate_table; truncate partition_truncate_table; rollback; select count(*) from partition_truncate_table; -ERROR: relation "partition_truncate_table" does not exist +ERROR: relation "partition_truncate_table" does not exist on datanode1 LINE 1: select count(*) from partition_truncate_table; ^ --can not find the table @@ -808,7 +807,7 @@ where c.relname = 'partition_truncate_table' and p.parentid = c.oid and ct.oid = truncate partition_truncate_table; rollback; select count(*) from partition_truncate_table; -ERROR: relation "partition_truncate_table" does not exist +ERROR: relation "partition_truncate_table" does not exist on datanode1 LINE 1: select count(*) from partition_truncate_table; ^ --table do not exist diff --git a/src/test/regress/output/hw_sslconn.source b/src/test/regress/output/hw_sslconn.source index 16259e329..6db19fe2a 100644 --- a/src/test/regress/output/hw_sslconn.source +++ b/src/test/regress/output/hw_sslconn.source @@ -1,33 +1,39 @@ -\! chmod 600 @abs_srcdir@/sslcert/* -\! cp @abs_srcdir@/sslcert/server.* @abs_srcdir@/tmp_check/coordinator1 -\! cp @abs_srcdir@/sslcert/cacert.pem @abs_srcdir@/tmp_check/coordinator1 +\! chmod 600 /data2/jiangyan/openGauss-server/src/test/regress/sslcert/* +\! cp /data2/jiangyan/openGauss-server/src/test/regress/sslcert/server.* /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 +cp: target '/data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1' is not a directory +\! cp /data2/jiangyan/openGauss-server/src/test/regress/sslcert/cacert.pem /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 \! export PGSSLMODE=verify-ca -\! export PGSSLROOTCERT=@abs_srcdir@/sslcert/cacert.pem -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c ssl=on >/dev/null 2>&1 -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c "ssl_ca_file='cacert.pem'" >/dev/null 2>&1 -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c "ssl_cert_file='server.crt'" >/dev/null 2>&1 -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c "ssl_key_file='server.key'" >/dev/null 2>&1 -\! sed -i 's#host.*all.*all.*127.0.0.1/32.*#hostssl all all 127.0.0.1/32 sha256#g' @abs_srcdir@/tmp_check/coordinator1/pg_hba.conf -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null +\! export PGSSLROOTCERT=/data2/jiangyan/openGauss-server/src/test/regress/sslcert/cacert.pem +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c ssl=on >/dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c "ssl_ca_file='cacert.pem'" >/dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c "ssl_cert_file='server.crt'" >/dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c "ssl_key_file='server.key'" >/dev/null 2>&1 +\! sed -i 's#host.*all.*all.*127.0.0.1/32.*#hostssl all all 127.0.0.1/32 sha256#g' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf: Not a directory +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl stop -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl start -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null \! sleep 5 -\! @abs_bindir@/gsql -d postgres -r -m -h 127.0.0.1 -p @portstring@ -W gauss@123 -c 'show ssl' - ssl ------ - on -(1 row) - -\! rm -rf @abs_srcdir@/tmp_check/coordinator1/server.* -\! rm -rf @abs_srcdir@/tmp_check/coordinator1/cacert.pem -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c ssl=off >/dev/null 2>&1 -\! sed -i 's/^ssl_ca_file/#&/' @abs_srcdir@/tmp_check/coordinator1/postgresql.conf -\! sed -i 's/^ssl_cert_file/#&/' @abs_srcdir@/tmp_check/coordinator1/postgresql.conf -\! sed -i 's/^ssl_key_file/#&/' @abs_srcdir@/tmp_check/coordinator1/postgresql.conf -\! sed -i 's#hostssl.*all.*all.*127.0.0.1/32.*sha256#host all all 127.0.0.1/32 sha256#g' @abs_srcdir@/tmp_check/coordinator1/pg_hba.conf -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! sleep 5 -\! @abs_bindir@/gsql -d postgres -h 127.0.0.1 -p @portstring@ -W gauss@123 -c 'show ssl' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d postgres -r -m -h 127.0.0.1 -p 25632 -W gauss@123 -c 'show ssl' + ssl +----- + off +(1 row) + +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/server.* +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/cacert.pem +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c ssl=off >/dev/null 2>&1 +\! sed -i 's/^ssl_ca_file/#&/' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf: Not a directory +\! sed -i 's/^ssl_cert_file/#&/' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf: Not a directory +\! sed -i 's/^ssl_key_file/#&/' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf: Not a directory +\! sed -i 's#hostssl.*all.*all.*127.0.0.1/32.*sha256#host all all 127.0.0.1/32 sha256#g' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf: Not a directory +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl stop -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl start -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! sleep 5 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d postgres -h 127.0.0.1 -p 25632 -W gauss@123 -c 'show ssl' ssl ----- off diff --git a/src/test/regress/output/hw_sslpwd.source b/src/test/regress/output/hw_sslpwd.source index 51bf7e2b1..24a1eda21 100644 --- a/src/test/regress/output/hw_sslpwd.source +++ b/src/test/regress/output/hw_sslpwd.source @@ -1,35 +1,36 @@ -\! chmod 600 @abs_srcdir@/sslcert_withpwd/* -\! @abs_bindir@/gs_guc encrypt -M client -K Gauss@123 -D @abs_srcdir@/sslcert_withpwd/ > /dev/null 2>&1 -gs_guc encrypt -M client -K *** -\! @abs_bindir@/gs_guc encrypt -M server -K Gauss@123 -D @abs_srcdir@/sslcert_withpwd/ > /dev/null 2>&1 -gs_guc encrypt -M server -K *** -\! cp @abs_srcdir@/sslcert_withpwd/server.* @abs_srcdir@/tmp_check/coordinator1 -\! cp @abs_srcdir@/sslcert_withpwd/client.* @abs_srcdir@/tmp_check/coordinator1 -\! cp @abs_srcdir@/sslcert_withpwd/cacert.pem @abs_srcdir@/tmp_check/coordinator1 +\! chmod 600 /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/* +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc encrypt -M client -K Gauss@123 -D /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/ > /dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc encrypt -M server -K Gauss@123 -D /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/ > /dev/null 2>&1 +\! cp /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/server.* /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 +cp: target '/data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1' is not a directory +\! cp /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/client.* /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 +cp: target '/data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1' is not a directory +\! cp /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/cacert.pem /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 \setenv PGSSLMODE prefer \! echo $PGSSLMODE prefer -\setenv PGSSLROOTCERT @abs_srcdir@/tmp_check/coordinator1/cacert.pem +\setenv PGSSLROOTCERT /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/cacert.pem \! echo $PGSSLROOTCERT -@abs_srcdir@/tmp_check/coordinator1/cacert.pem -\setenv PGSSLCERT @abs_srcdir@/tmp_check/coordinator1/client.crt +/data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/cacert.pem +\setenv PGSSLCERT /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/client.crt \! echo $PGSSLCERT -@abs_srcdir@/tmp_check/coordinator1/client.crt -\setenv PGSSLKEY @abs_srcdir@/tmp_check/coordinator1/client.key +/data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/client.crt +\setenv PGSSLKEY /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/client.key \! echo $PGSSLKEY -@abs_srcdir@/tmp_check/coordinator1/client.key -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c ssl=on >/dev/null 2>&1 -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c "ssl_ca_file='cacert.pem'" >/dev/null 2>&1 -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c "ssl_cert_file='server.crt'" >/dev/null 2>&1 -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c "ssl_key_file='server.key'" >/dev/null 2>&1 -\! sed -i 's#host.*all.*all.*127.0.0.1/32.*#hostssl all all 127.0.0.1/32 sha256#g' @abs_srcdir@/tmp_check/coordinator1/pg_hba.conf -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null +/data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/client.key +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c ssl=on >/dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c "ssl_ca_file='cacert.pem'" >/dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c "ssl_cert_file='server.crt'" >/dev/null 2>&1 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c "ssl_key_file='server.key'" >/dev/null 2>&1 +\! sed -i 's#host.*all.*all.*127.0.0.1/32.*#hostssl all all 127.0.0.1/32 sha256#g' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf: Not a directory +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl stop -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl start -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null \! sleep 5 -\! @abs_bindir@/gsql -d postgres -r -h 127.0.0.1 -p @portstring@ -W gauss@123 -c 'show ssl' +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d postgres -r -h 127.0.0.1 -p 25632 -W gauss@123 -c 'show ssl' ssl ----- - on + off (1 row) \setenv PGSSLMODE @@ -44,31 +45,36 @@ prefer \setenv PGSSLKEY \! echo $PGSSLKEY -\! sed -i 's#hostssl.*all.*all.*127.0.0.1/32.*sha256#host all all 127.0.0.1/32 sha256#g' @abs_srcdir@/tmp_check/coordinator1/pg_hba.conf -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! @abs_bindir@/gsql -d postgres -r -h 127.0.0.1 -p @portstring@ -W gauss@123 -c 'show ssl' - ssl ------ - on -(1 row) - -\! rm -rf @abs_srcdir@/tmp_check/coordinator1/server.* -\! rm -rf @abs_srcdir@/tmp_check/coordinator1/client.* -\! rm -rf @abs_srcdir@/tmp_check/coordinator1/cacert.pem -\! @abs_bindir@/gs_guc set -Z coordinator -D @abs_srcdir@/tmp_check/coordinator1 -c ssl=off >/dev/null 2>&1 -\! sed -i 's/^ssl_ca_file/#&/' @abs_srcdir@/tmp_check/coordinator1/postgresql.conf -\! sed -i 's/^ssl_cert_file/#&/' @abs_srcdir@/tmp_check/coordinator1/postgresql.conf -\! sed -i 's/^ssl_key_file/#&/' @abs_srcdir@/tmp_check/coordinator1/postgresql.conf -\! sed -i 's#hostssl.*all.*all.*127.0.0.1/32.*sha256#host all all 127.0.0.1/32 sha256#g' @abs_srcdir@/tmp_check/coordinator1/pg_hba.conf -\! @abs_bindir@/gs_ctl stop -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! @abs_bindir@/gs_ctl start -D @abs_srcdir@/tmp_check/coordinator1 -Z coordinator > /dev/null -\! sleep 5 -\! @abs_bindir@/gsql -d postgres -h 127.0.0.1 -p @portstring@ -W gauss@123 -c 'show ssl' +\! sed -i 's#hostssl.*all.*all.*127.0.0.1/32.*sha256#host all all 127.0.0.1/32 sha256#g' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf: Not a directory +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl stop -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl start -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d postgres -r -h 127.0.0.1 -p 25632 -W gauss@123 -c 'show ssl' ssl ----- off (1 row) -\! rm -rf @abs_srcdir@/sslcert_withpwd/server.key.* -\! rm -rf @abs_srcdir@/sslcert_withpwd/client.key.* +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/server.* +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/client.* +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/cacert.pem +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_guc set -Z coordinator -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -c ssl=off >/dev/null 2>&1 +\! sed -i 's/^ssl_ca_file/#&/' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf: Not a directory +\! sed -i 's/^ssl_cert_file/#&/' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf: Not a directory +\! sed -i 's/^ssl_key_file/#&/' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/postgresql.conf: Not a directory +\! sed -i 's#hostssl.*all.*all.*127.0.0.1/32.*sha256#host all all 127.0.0.1/32 sha256#g' /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf +sed: can't read /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1/pg_hba.conf: Not a directory +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl stop -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gs_ctl start -D /data2/jiangyan/openGauss-server/src/test/regress/tmp_check/coordinator1 -Z coordinator > /dev/null +\! sleep 5 +\! /data2/jiangyan/openGauss-server/src/test/regress/./tmp_check/install//data2/jiangyan/openGauss-server_/dest/bin/gsql -d postgres -h 127.0.0.1 -p 25632 -W gauss@123 -c 'show ssl' + ssl +----- + off +(1 row) + +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/server.key.* +\! rm -rf /data2/jiangyan/openGauss-server/src/test/regress/sslcert_withpwd/client.key.* diff --git a/src/test/regress/output/inlist2join_cost_base.source b/src/test/regress/output/inlist2join_cost_base.source index 4155053fd..b259f35a9 100644 --- a/src/test/regress/output/inlist2join_cost_base.source +++ b/src/test/regress/output/inlist2join_cost_base.source @@ -6,82 +6,70 @@ set qrw_inlist2join_optmode=-1; ERROR: invalid value for parameter "qrw_inlist2join_optmode": "-1" DETAIL: Available values: disable, cost_base, rule_base, or any positive integer as a inlist2join threshold set qrw_inlist2join_optmode=cost_base; -create table t1(c1 int, c2 int, c3 int) distribute by hash(c1); -copy t1 from '@abs_srcdir@/data/inlist2join.data'; -create table t2(c1 int, c2 int, c3 int) distribute by hash(c1); +create table t1(c1 int, c2 int, c3 int); +copy t1 from '/data2/jiangyan/openGauss-server/src/test/regress/data/inlist2join.data'; +create table t2(c1 int, c2 int, c3 int); insert into t2 select * from t1; ANALYZE t1; ANALYZE t2; -- T_HashJoin T_Stream T_SubqueryScan explain (costs off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; - QUERY PLAN ------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: t2.c3, t2.c2 - -> Sort - Sort Key: t2.c3, t2.c2 - -> Hash Semi Join - Hash Cond: (t2.c2 = inlist2join_cost_base.t1.c2) - -> Seq Scan on t2 - Filter: (c1 > 1) - -> Hash - -> Streaming(type: BROADCAST) - -> Hash Semi Join - Hash Cond: (inlist2join_cost_base.t1.c1 = "*VALUES*".column1) - -> Seq Scan on t1 - -> Hash - -> Streaming(type: REDISTRIBUTE) - -> Values Scan on "*VALUES*" -(16 rows) + QUERY PLAN +----------------------------------------------------------------------------------- + Sort + Sort Key: t2.c3, t2.c2 + -> Hash Semi Join + Hash Cond: (t2.c2 = inlist2join_cost_base.t1.c2) + -> Seq Scan on t2 + Filter: (c1 > 1) + -> Hash + -> Hash Semi Join + Hash Cond: (inlist2join_cost_base.t1.c1 = "*VALUES*".column1) + -> Seq Scan on t1 + -> Hash + -> Values Scan on "*VALUES*" +(12 rows) -- T_MergeJoin set enable_hashjoin =off; explain (costs off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; - QUERY PLAN ------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: t2.c3, t2.c2 - -> Sort - Sort Key: t2.c3, t2.c2 - -> Merge Semi Join - Merge Cond: (t2.c2 = inlist2join_cost_base.t1.c2) - -> Sort - Sort Key: t2.c2 - -> Seq Scan on t2 - Filter: (c1 > 1) - -> Sort - Sort Key: inlist2join_cost_base.t1.c2 - -> Streaming(type: BROADCAST) - -> Merge Semi Join - Merge Cond: (inlist2join_cost_base.t1.c1 = "*VALUES*".column1) - -> Sort - Sort Key: inlist2join_cost_base.t1.c1 - -> Seq Scan on t1 - -> Sort - Sort Key: "*VALUES*".column1 - -> Streaming(type: REDISTRIBUTE) - -> Values Scan on "*VALUES*" -(22 rows) + QUERY PLAN +------------------------------------------------------------------------------------ + Sort + Sort Key: t2.c3, t2.c2 + -> Merge Semi Join + Merge Cond: (t2.c2 = inlist2join_cost_base.t1.c2) + -> Sort + Sort Key: t2.c2 + -> Seq Scan on t2 + Filter: (c1 > 1) + -> Sort + Sort Key: inlist2join_cost_base.t1.c2 + -> Merge Semi Join + Merge Cond: (inlist2join_cost_base.t1.c1 = "*VALUES*".column1) + -> Sort + Sort Key: inlist2join_cost_base.t1.c1 + -> Seq Scan on t1 + -> Sort + Sort Key: "*VALUES*".column1 + -> Values Scan on "*VALUES*" +(18 rows) -- T_MergeJoin T_Material set enable_mergejoin = off; explain (costs off) select t2.c3, t2.c2 from t2 where t2.c1 > 1 AND t2.c2 in (select t1.c2 from t1 where t1.c1 IN (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279)) order by 1,2; - QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - Streaming (type: GATHER) - Merge Sort Key: t2.c3, t2.c2 - -> Sort - Sort Key: t2.c3, t2.c2 - -> Nested Loop Semi Join - Join Filter: (t2.c2 = t1.c2) - -> Streaming(type: REDISTRIBUTE) - -> Seq Scan on t2 - Filter: (c1 > 1) - -> Materialize - -> Streaming(type: REDISTRIBUTE) - -> Seq Scan on t1 - Filter: (c1 = ANY ('{22376,7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189,6675,49103,65433,12945,31682,2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991,5747,45109,74104,17051,73311,67981,72523,89732,97553,7721,2093,60644,66857,18634,79095,44341,11184,72487,3615,48173,17393,27185,6279,69965,22133,2138,33295,32935,49062,76352,27384,49675,39611,11423,3726,43077,97087,70532,47240,74421,83989,59023,29279}'::integer[])) -(13 rows) + QUERY PLAN +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: t2.c3, t2.c2 + -> Nested Loop Semi Join + Join Filter: (t2.c2 = t1.c2) + -> Seq Scan on t2 + Filter: (c1 > 1) + -> Materialize + -> Seq Scan on t1 + Filter: (c1 = ANY ('{22376,7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189,6675,49103,65433,12945,31682,2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991,5747,45109,74104,17051,73311,67981,72523,89732,97553,7721,2093,60644,66857,18634,79095,44341,11184,72487,3615,48173,17393,27185,6279,69965,22133,2138,33295,32935,49062,76352,27384,49675,39611,11423,3726,43077,97087,70532,47240,74421,83989,59023,29279}'::integer[])) +(9 rows) create index index1 on t1(c1); create index index2 on t2(c1); @@ -90,34 +78,29 @@ set enable_nestloop =on; set enable_hashjoin = on; set enable_bitmapscan = off; explain (costs off) select * from (select * from t1 where t1.c1 in (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793) union all select * from t2) as dt where dt.c1 in ( 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279) order by 1; - QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - Merge Sort Key: inlist2join_cost_base.t1.c1 - -> Sort - Sort Key: inlist2join_cost_base.t1.c1 - -> Result - -> Append - -> Nested Loop Semi Join - Join Filter: (inlist2join_cost_base.t1.c1 = "*VALUES*".column1) - -> Nested Loop - -> Streaming(type: REDISTRIBUTE) - -> HashAggregate - Group By Key: "*VALUES*".column1 - -> Values Scan on "*VALUES*" - -> Index Scan using index1 on t1 - Index Cond: (c1 = "*VALUES*".column1) - -> Materialize - -> Streaming(type: REDISTRIBUTE) - -> Values Scan on "*VALUES*" - -> Index Scan using index2 on t2 - Index Cond: (c1 = ANY ('{2093,60644,66857,18634,79095,44341,11184,72487,3615,48173,17393,27185,6279,69965,22133,2138,33295,32935,49062,76352,27384,49675,39611,11423,3726,43077,97087,70532,47240,74421,83989,59023,29279}'::integer[])) -(20 rows) + QUERY PLAN +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Sort + Sort Key: inlist2join_cost_base.t1.c1 + -> Result + -> Append + -> Hash Semi Join + Hash Cond: (inlist2join_cost_base.t1.c1 = "*VALUES*".column1) + -> Nested Loop + -> HashAggregate + Group By Key: "*VALUES*".column1 + -> Values Scan on "*VALUES*" + -> Index Scan using index1 on t1 + Index Cond: (c1 = "*VALUES*".column1) + -> Hash + -> Values Scan on "*VALUES*" + -> Index Scan using index2 on t2 + Index Cond: (c1 = ANY ('{2093,60644,66857,18634,79095,44341,11184,72487,3615,48173,17393,27185,6279,69965,22133,2138,33295,32935,49062,76352,27384,49675,39611,11423,3726,43077,97087,70532,47240,74421,83989,59023,29279}'::integer[])) +(16 rows) -- T_MergeAppend -- partition table create table t1_p(c1 int, c2 int, c3 int) -distribute by hash(c1) PARTITION BY RANGE(c1) ( PARTITION P1 VALUES LESS THAN(20000), @@ -127,7 +110,6 @@ PARTITION P4 VALUES LESS THAN(80000), PARTITION P8 VALUES LESS THAN(MAXVALUE) ); create table t2_p(c1 int, c2 int, c3 int) -distribute by hash(c1) PARTITION BY RANGE(c1) ( PARTITION P1 VALUES LESS THAN(30000), @@ -141,11 +123,19 @@ ANALYZE t1_p; ANALYZE t2_p; -- T_PartIterator explain (costs off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2_p.c2 in (1,2,3,4,5,6,7,8,9,10,11); - QUERY PLAN -------------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Nested Loop - Join Filter: (inlist2join_cost_base.t2_p.c2 = inlist2join_cost_base.t1_p.c1) + QUERY PLAN +-------------------------------------------------------------------------------- + Nested Loop + Join Filter: (inlist2join_cost_base.t2_p.c2 = inlist2join_cost_base.t1_p.c1) + -> Hash Semi Join + Hash Cond: (inlist2join_cost_base.t2_p.c2 = "*VALUES*".column1) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t2_p + Selected Partitions: 1..4 + -> Hash + -> Values Scan on "*VALUES*" + -> Materialize -> Hash Semi Join Hash Cond: (inlist2join_cost_base.t1_p.c1 = "*VALUES*".column1) -> Partition Iterator @@ -153,66 +143,44 @@ explain (costs off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2 -> Partitioned Seq Scan on t1_p Selected Partitions: 1..5 -> Hash - -> Streaming(type: REDISTRIBUTE) - -> Values Scan on "*VALUES*" - -> Materialize - -> Streaming(type: REDISTRIBUTE) - -> Hash Semi Join - Hash Cond: (inlist2join_cost_base.t2_p.c2 = "*VALUES*".column1) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t2_p - Selected Partitions: 1..4 - -> Hash - -> Values Scan on "*VALUES*" -(22 rows) + -> Values Scan on "*VALUES*" +(19 rows) set enable_nestloop =off; explain (costs off) select t2_p.c2 from t2_p join t1_p on t1_p.c1=t2_p.c2 and t2_p.c2 in (22376, 7697,91842,32482,49627,89493,83303,64430,62630,12468,41219,86264,57512,26467,83933,90814,96326,94490,16793,30622,54667,71608,83944,40124,90224,11409,47022,93382,33348,22693,40793,84920,13919,79189, 6675,49103,65433,12945,31682, 2106,42248,61990,66384,86546,62487,60545,74527,73315,42924,47691,88203,67892,26852,72041,35315,33527,57991, 5747, 45109,74104,17051,73311,67981,72523,89732,97553, 7721, 2093,60644,66857,18634,79095,44341,11184,72487, 3615,48173,17393,27185, 6279,69965,22133, 2138,33295,32935,49062,76352,27384,49675,39611,11423, 3726,43077,97087,70532,47240,74421,83989,59023,29279); - QUERY PLAN -------------------------------------------------------------------------------------- - Streaming (type: GATHER) - -> Hash Join - Hash Cond: (inlist2join_cost_base.t2_p.c2 = inlist2join_cost_base.t1_p.c1) - -> Streaming(type: REDISTRIBUTE) - -> Hash Semi Join - Hash Cond: (inlist2join_cost_base.t2_p.c2 = "*VALUES*".column1) - -> Partition Iterator - Iterations: 4 - -> Partitioned Seq Scan on t2_p - Selected Partitions: 1..4 - -> Hash - -> Values Scan on "*VALUES*" + QUERY PLAN +------------------------------------------------------------------------------- + Hash Join + Hash Cond: (inlist2join_cost_base.t1_p.c1 = inlist2join_cost_base.t2_p.c2) + -> Hash Semi Join + Hash Cond: (inlist2join_cost_base.t1_p.c1 = "*VALUES*".column1) + -> Partition Iterator + Iterations: 5 + -> Partitioned Seq Scan on t1_p + Selected Partitions: 1..5 -> Hash - -> Hash Semi Join - Hash Cond: (inlist2join_cost_base.t1_p.c1 = "*VALUES*".column1) - -> Partition Iterator - Iterations: 5 - -> Partitioned Seq Scan on t1_p - Selected Partitions: 1..5 - -> Hash - -> Streaming(type: REDISTRIBUTE) - -> Values Scan on "*VALUES*" -(22 rows) + -> Values Scan on "*VALUES*" + -> Hash + -> Hash Semi Join + Hash Cond: (inlist2join_cost_base.t2_p.c2 = "*VALUES*".column1) + -> Partition Iterator + Iterations: 4 + -> Partitioned Seq Scan on t2_p + Selected Partitions: 1..4 + -> Hash + -> Values Scan on "*VALUES*" +(19 rows) set enable_nestloop =on; -- T_WindowAgg plan explain (costs off) select c1,c2,avg(c3) OVER (PARTITION BY c1) from t1 where t1.c1 in (1,2,3,4,5,6,7,8,9,10,11) and t1.c2 in (1,2); - QUERY PLAN -------------------------------------------------------------------- - Streaming (type: GATHER) - -> WindowAgg - -> Sort - Sort Key: inlist2join_cost_base.t1.c1 - -> Nested Loop - -> Streaming(type: REDISTRIBUTE) - -> HashAggregate - Group By Key: "*VALUES*".column1 - -> Values Scan on "*VALUES*" - -> Index Scan using index1 on t1 - Index Cond: (c1 = "*VALUES*".column1) - Filter: (c2 = ANY ('{1,2}'::integer[])) -(12 rows) + QUERY PLAN +------------------------------------------------------------------------- + WindowAgg + -> Index Scan using index1 on t1 + Index Cond: (c1 = ANY ('{1,2,3,4,5,6,7,8,9,10,11}'::integer[])) + Filter: (c2 = ANY ('{1,2}'::integer[])) +(4 rows) drop schema inlist2join_cost_base cascade; NOTICE: drop cascades to 4 other objects diff --git a/src/test/regress/output/vec_hashjoin1.source b/src/test/regress/output/vec_hashjoin1.source index b1206ab1f..6ca30deed 100644 --- a/src/test/regress/output/vec_hashjoin1.source +++ b/src/test/regress/output/vec_hashjoin1.source @@ -71,7 +71,7 @@ CREATE TABLE vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_02( C_DP double precision, C_DATE DATE, C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE, - C_TS_WITH TIMESTAMP WITH TIME ZONE, PARTIAL CLUSTER KEY(C_INT))WITH (ORIENTATION=COLUMN) DISTRIBUTE BY HASH (C_INT); + C_TS_WITH TIMESTAMP WITH TIME ZONE, PARTIAL CLUSTER KEY(C_INT))WITH (ORIENTATION=COLUMN); CREATE TABLE vector_hashjoin_engine.ROW_HASHJOIN_TABLE_03( C_CHAR_1 CHAR(1), C_CHAR_2 CHAR(10), @@ -141,47 +141,47 @@ CREATE TABLE vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_03( c1 int ,c2 int ,c3 char(100) -)distribute by hash(c1); +); create table vector_hashjoin_engine.ROW_HASHJOIN_TABLE_06 ( c1 int ,c2 int ,c3 char(100) -)distribute by hash(c2); +); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_05 ( c1 int ,c2 int ,c3 char(100) -)with (orientation = column) distribute by hash(c1); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_06 ( c1 int ,c2 int ,c3 char(100) -)with (orientation = column) distribute by hash(c2); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_09 ( c1 int1 ,c2 int -)with (orientation = column) distribute by hash(c2); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_10 ( c1 int1 ,c2 int -)with (orientation = column) distribute by hash(c2); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_13 ( c1 int not null ,c2 bigint not null ,c3 char(6) not null -)with (orientation = column) distribute by hash(c1); +)with (orientation = column); create table vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_14 ( c1 int not null ,c2 bigint not null ,c3 char(6) not null -)with (orientation = column) distribute by hash(c1); +)with (orientation = column); CREATE OR REPLACE PROCEDURE func_insert_tbl_hashjoin_01() AS BEGIN @@ -260,9 +260,9 @@ CALL func_insert_tbl_hashjoin_04(); \parallel on 2 --insert into ROW_HASHJOIN_TABLE_05 select generate_series(1,2000), generate_series(1,2000), 'row'|| generate_series(1,2000); -copy ROW_HASHJOIN_TABLE_05 from '@abs_srcdir@/data/vec_hashjoin1_data1.txt' delimiter as ' '; +copy ROW_HASHJOIN_TABLE_05 from '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/vec_hashjoin1_data1.txt' delimiter as ' '; --insert into ROW_HASHJOIN_TABLE_06 select generate_series(5000,6000,1), generate_series(5000,6000,1), 'row'|| generate_series(1,1001); -copy ROW_HASHJOIN_TABLE_06 from '@abs_srcdir@/data/vec_hashjoin1_data2.txt' delimiter as ' '; +copy ROW_HASHJOIN_TABLE_06 from '/usr3/data1/jiangyan/openGauss-server/src/test/regress/data/vec_hashjoin1_data2.txt' delimiter as ' '; \parallel off \parallel on 8 INSERT INTO vector_hashjoin_engine.VECTOR_HASHJOIN_TABLE_01 SELECT * FROM vector_hashjoin_engine.ROW_HASHJOIN_TABLE_01; @@ -294,33 +294,23 @@ set enable_mergejoin=off; --- case 1: HashJoin Inner Join ---- explain (verbose on, costs off) SELECT A.C_INT, A.C_BIGINT, A.C_VARCHAR_3, A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A INNER JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT <8 AND A.C_BIGINT<9 ORDER BY 1, 2; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - -> Vector Streaming (type: GATHER) + -> Vector Sort Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Merge Sort Key: a.c_int, a.c_bigint - Node/s: All datanodes - -> Vector Sort + Sort Key: a.c_int, a.c_bigint + -> Vector Sonic Hash Join Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Sort Key: a.c_int, a.c_bigint - -> Vector Sonic Hash Join + Hash Cond: (a.c_int = b.c_int) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_01 a Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Hash Cond: (a.c_int = b.c_int) - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_01 a - Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Distribute Key: a.c_char_1 - Filter: ((a.c_int < 8) AND (a.c_bigint < 9)) - -> Vector Streaming(type: BROADCAST) - Output: b.c_int - Spawn on: All datanodes - Consumer Nodes: All datanodes - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_02 b - Output: b.c_int - Distribute Key: b.c_int - Filter: (b.c_int < 8) -(24 rows) + Filter: ((a.c_int < 8) AND (a.c_bigint < 9)) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_02 b + Output: b.c_int + Filter: (b.c_int < 8) +(14 rows) SELECT A.C_INT, A.C_BIGINT, A.C_VARCHAR_3, A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A INNER JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT <10 AND A.C_BIGINT<5 ORDER BY 1, 2; c_int | c_bigint | c_varchar_3 | c_date @@ -658,33 +648,22 @@ SELECT count(*) from VECTOR_HASHJOIN_TABLE_03 A inner join VECTOR_HASHJOIN_TABLE --- case 2: HashJoin Left/Right Join ---- explain (verbose on, costs off) SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT >45 AND A.C_BIGINT>28 ORDER BY 1, 2; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - -> Vector Streaming (type: GATHER) + -> Vector Sort Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Merge Sort Key: a.c_int, a.c_bigint - Node/s: All datanodes - -> Vector Sort + Sort Key: a.c_int, a.c_bigint + -> Vector Hash Right Join Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Sort Key: a.c_int, a.c_bigint - -> Vector Hash Left Join + Hash Cond: (b.c_int = a.c_int) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_02 b + Output: b.c_int + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_01 a Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Hash Cond: (a.c_int = b.c_int) - -> Vector Streaming(type: REDISTRIBUTE) - Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Distribute Key: a.c_int - Spawn on: All datanodes - Consumer Nodes: All datanodes - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_01 a - Output: a.c_int, a.c_bigint, a.c_varchar_3, a.c_date - Distribute Key: a.c_char_1 - Filter: ((a.c_int > 45) AND (a.c_bigint > 28)) - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_02 b - Output: b.c_int - Distribute Key: b.c_int -(24 rows) + Filter: ((a.c_int > 45) AND (a.c_bigint > 28)) +(13 rows) SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT >10 AND A.C_BIGINT>5 ORDER BY 1, 2; c_int | c_bigint | c_varchar_3 | c_date @@ -1193,31 +1172,23 @@ SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A --SELECT A.C_INT,A.C_BIGINT,A.C_VARCHAR_3,A.C_DATE FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT WHERE A.C_INT <10 AND A.C_BIGINT>5 ORDER BY 1, 2; explain (verbose on, costs off) SELECT A.C_INT,A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT and A.C_BIGINT > 1000 WHERE A.C_INT <4 ORDER BY 1, 2; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter Output: a.c_int, a.c_bigint - -> Vector Streaming (type: GATHER) + -> Vector Sort Output: a.c_int, a.c_bigint - Merge Sort Key: a.c_int, a.c_bigint - -> Vector Sort + Sort Key: a.c_int, a.c_bigint + -> Vector Hash Right Join Output: a.c_int, a.c_bigint - Sort Key: a.c_int, a.c_bigint - -> Vector Hash Left Join + Hash Cond: (b.c_int = a.c_int) + Join Filter: (a.c_bigint > 1000) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_02 b + Output: b.c_int + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_01 a Output: a.c_int, a.c_bigint - Hash Cond: (a.c_int = b.c_int) - Join Filter: (a.c_bigint > 1000) - -> Vector Streaming(type: REDISTRIBUTE) - Output: a.c_int, a.c_bigint - Distribute Key: a.c_int - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_01 a - Output: a.c_int, a.c_bigint - Distribute Key: a.c_char_1 - Filter: (a.c_int < 4) - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_02 b - Output: b.c_int - Distribute Key: b.c_int -(22 rows) + Filter: (a.c_int < 4) +(14 rows) SELECT A.C_INT,A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_01 A LEFT JOIN VECTOR_HASHJOIN_TABLE_02 B ON A.C_INT = B.C_INT and A.C_BIGINT > 1000 WHERE A.C_INT <4 ORDER BY 1, 2; c_int | c_bigint @@ -1355,33 +1326,22 @@ SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HA --- case 3: HashJoin Anti Join ---- explain (verbose on, costs off) SELECT B.C_INT , A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT AND A.C_BIGINT<2 where B.C_INT is NULL order by 1,2; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter Output: b.c_int, a.c_bigint - -> Vector Streaming (type: GATHER) + -> Vector Sort Output: b.c_int, a.c_bigint - Merge Sort Key: b.c_int, a.c_bigint - -> Vector Sort + Sort Key: b.c_int, a.c_bigint + -> Vector Hash Anti Join Output: b.c_int, a.c_bigint - Sort Key: b.c_int, a.c_bigint - -> Vector Hash Anti Join - Output: b.c_int, a.c_bigint - Hash Cond: (a.c_int = b.c_int) - Join Filter: (a.c_bigint < 2) - -> Vector Streaming(type: REDISTRIBUTE) - Output: a.c_bigint, a.c_int - Distribute Key: a.c_int - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_03 a - Output: a.c_bigint, a.c_int - Distribute Key: a.c_char_1 - -> Vector Streaming(type: REDISTRIBUTE) - Output: b.c_int - Distribute Key: b.c_int - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_04 b - Output: b.c_int - Distribute Key: b.c_char_1 -(24 rows) + Hash Cond: (a.c_int = b.c_int) + Join Filter: (a.c_bigint < 2) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_03 a + Output: a.c_bigint, a.c_int + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_04 b + Output: b.c_int +(13 rows) SELECT B.C_INT , A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT AND A.C_BIGINT<2 where B.C_INT is NULL order by 1,2; c_int | c_bigint @@ -1429,32 +1389,21 @@ SELECT B.C_INT , A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_ (40 rows) explain (verbose on, costs off) SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT where B.C_INT is NULL order by 1,2; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter Output: b.c_int, a.c_bigint - -> Vector Streaming (type: GATHER) + -> Vector Sort Output: b.c_int, a.c_bigint - Merge Sort Key: b.c_int, a.c_bigint - -> Vector Sort + Sort Key: b.c_int, a.c_bigint + -> Vector Hash Anti Join Output: b.c_int, a.c_bigint - Sort Key: b.c_int, a.c_bigint - -> Vector Hash Anti Join - Output: b.c_int, a.c_bigint - Hash Cond: (a.c_int = b.c_int) - -> Vector Streaming(type: REDISTRIBUTE) - Output: a.c_bigint, a.c_int - Distribute Key: a.c_int - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_03 a - Output: a.c_bigint, a.c_int - Distribute Key: a.c_char_1 - -> Vector Streaming(type: REDISTRIBUTE) - Output: b.c_int - Distribute Key: b.c_int - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_04 b - Output: b.c_int - Distribute Key: b.c_char_1 -(23 rows) + Hash Cond: (a.c_int = b.c_int) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_03 a + Output: a.c_bigint, a.c_int + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_04 b + Output: b.c_int +(12 rows) SELECT B.C_INT, A.C_BIGINT FROM VECTOR_HASHJOIN_TABLE_04 B RIGHT JOIN VECTOR_HASHJOIN_TABLE_03 A ON A.C_INT = B.C_INT where B.C_INT is NULL order by 1,2; c_int | c_bigint @@ -8017,27 +7966,20 @@ reset work_mem; --- case : test innerjoin codegen with fast path ---- explain (verbose on, costs off) select count(*) from VECTOR_HASHJOIN_TABLE_13 A inner join VECTOR_HASHJOIN_TABLE_14 B on A.c1 = B.c1; - QUERY PLAN ------------------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Row Adapter - Output: (pg_catalog.count(*)) + Output: (count(*)) -> Vector Aggregate - Output: pg_catalog.count(*) - -> Vector Streaming (type: GATHER) - Output: (count(*)) - Node/s: All datanodes - -> Vector Aggregate - Output: count(*) - -> Vector Sonic Hash Join - Output: 'Dummy' - Hash Cond: (b.c1 = a.c1) - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_14 b - Output: b.c1 - Distribute Key: b.c1 - -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_13 a - Output: a.c1 - Distribute Key: a.c1 -(18 rows) + Output: count(*) + -> Vector Sonic Hash Join + Output: 'Dummy' + Hash Cond: (b.c1 = a.c1) + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_14 b + Output: b.c1 + -> CStore Scan on vector_hashjoin_engine.vector_hashjoin_table_13 a + Output: a.c1 +(11 rows) select count(*) from VECTOR_HASHJOIN_TABLE_13 A inner join VECTOR_HASHJOIN_TABLE_14 B on A.c1 = B.c1; count @@ -8073,22 +8015,17 @@ set enable_nestloop=off; set query_dop=1; explain (costs off) select 2/(coalesce(t1.c2,0)+ coalesce(t2.c1,0)) from t1, t2 where t1.c1 = t2.c2 and (coalesce(t2.c1, 0) + coalesce(t1.c2, 0))> 0 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) - Node/s: All datanodes - -> Vector Sort - Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) - -> Vector Sonic Hash Join - Hash Cond: (t2.c2 = t1.c1) - Join Filter: ((COALESCE(t2.c1, 0) + COALESCE(t1.c2, 0)) > 0) - -> Vector Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> CStore Scan on t2 - -> CStore Scan on t1 -(13 rows) + -> Vector Sort + Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) + -> Vector Sonic Hash Join + Hash Cond: (t1.c1 = t2.c2) + Join Filter: ((COALESCE(t2.c1, 0) + COALESCE(t1.c2, 0)) > 0) + -> CStore Scan on t1 + -> CStore Scan on t2 +(8 rows) select 2/(coalesce(t1.c2,0)+ coalesce(t2.c1,0)) from t1, t2 where t1.c1 = t2.c2 and (coalesce(t2.c1, 0) + coalesce(t1.c2, 0))> 0 order by 1; ?column? @@ -8104,22 +8041,17 @@ set enable_nestloop=off; set query_dop=1; explain (costs off) select 2/(coalesce(t1.c2,0)+ coalesce(t2.c1,0)) from t1, t2 where t1.c1 = t2.c2 and (coalesce(t2.c1, 0) + coalesce(t1.c2, 0))> 0 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) - Node/s: All datanodes - -> Vector Sort - Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) - -> Vector Hash Join - Hash Cond: (t2.c2 = t1.c1) - Join Filter: ((COALESCE(t2.c1, 0) + COALESCE(t1.c2, 0)) > 0) - -> Vector Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> CStore Scan on t2 - -> CStore Scan on t1 -(13 rows) + -> Vector Sort + Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) + -> Vector Hash Join + Hash Cond: (t1.c1 = t2.c2) + Join Filter: ((COALESCE(t2.c1, 0) + COALESCE(t1.c2, 0)) > 0) + -> CStore Scan on t1 + -> CStore Scan on t2 +(8 rows) select 2/(coalesce(t1.c2,0)+ coalesce(t2.c1,0)) from t1, t2 where t1.c1 = t2.c2 and (coalesce(t2.c1, 0) + coalesce(t1.c2, 0))> 0 order by 1; ?column? @@ -8134,26 +8066,21 @@ set enable_nestloop=off; set query_dop=1; explain (costs off) select 2/(coalesce(t1.c2,0)+ coalesce(t2.c1,0)) from t1, t2 where t1.c1 = t2.c2 and (coalesce(t2.c1, 0) + coalesce(t1.c2, 0))> 0 order by 1; - QUERY PLAN ----------------------------------------------------------------------------------- + QUERY PLAN +---------------------------------------------------------------------------- Row Adapter - -> Vector Streaming (type: GATHER) - Merge Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) - Node/s: All datanodes - -> Vector Sort - Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) - -> Vector Merge Join - Merge Cond: (t1.c1 = t2.c2) - Join Filter: ((COALESCE(t2.c1, 0) + COALESCE(t1.c2, 0)) > 0) - -> Vector Sort - Sort Key: t1.c1 - -> CStore Scan on t1 - -> Vector Sort - Sort Key: t2.c2 - -> Vector Streaming(type: REDISTRIBUTE) - Spawn on: All datanodes - -> CStore Scan on t2 -(17 rows) + -> Vector Sort + Sort Key: ((2 / (COALESCE(t1.c2, 0) + COALESCE(t2.c1, 0)))) + -> Vector Merge Join + Merge Cond: (t1.c1 = t2.c2) + Join Filter: ((COALESCE(t2.c1, 0) + COALESCE(t1.c2, 0)) > 0) + -> Vector Sort + Sort Key: t1.c1 + -> CStore Scan on t1 + -> Vector Sort + Sort Key: t2.c2 + -> CStore Scan on t2 +(12 rows) select 2/(coalesce(t1.c2,0)+ coalesce(t2.c1,0)) from t1, t2 where t1.c1 = t2.c2 and (coalesce(t2.c1, 0) + coalesce(t1.c2, 0))> 0 order by 1; ?column? diff --git a/src/test/regress/sql/AMHeap_dml_operate.sql b/src/test/regress/sql/AMHeap_dml_operate.sql index 749c0f9bb..0ff09bd24 100644 --- a/src/test/regress/sql/AMHeap_dml_operate.sql +++ b/src/test/regress/sql/AMHeap_dml_operate.sql @@ -303,7 +303,7 @@ SET ENABLE_MERGEJOIN = ON; SET ENABLE_NESTLOOP = OFF; SET ENABLE_HASHJOIN = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; +EXPLAIN (COSTS OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) order by 1, 2, 3 limit 10; drop table partition_heap_test_t1; @@ -336,7 +336,7 @@ SET ENABLE_MERGEJOIN = ON; SET ENABLE_NESTLOOP = OFF; SET ENABLE_HASHJOIN = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; +EXPLAIN (COSTS OFF) SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) ORDER BY 1,2,3; SELECT partition_heap_test_t1.*, partition_heap_test_t2.B FROM partition_heap_test_t1 INNER JOIN partition_heap_test_t2 ON (partition_heap_test_t1.A = partition_heap_test_t2.A) order by 1, 2, 3; drop table partition_heap_test_t1; diff --git a/src/test/regress/sql/AMHeap_scan.sql b/src/test/regress/sql/AMHeap_scan.sql index e65acdaea..937c62be1 100644 --- a/src/test/regress/sql/AMHeap_scan.sql +++ b/src/test/regress/sql/AMHeap_scan.sql @@ -52,19 +52,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -95,19 +95,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -138,19 +138,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -183,19 +183,19 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -226,19 +226,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -269,19 +269,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -312,19 +312,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -355,19 +355,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -400,19 +400,19 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -424,9 +424,9 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca -- rsult of FULL join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- result of no partition to join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; @@ -447,19 +447,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -471,9 +471,9 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca -- rsult of FULL join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- result of no partition to join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; @@ -494,19 +494,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -518,9 +518,9 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca -- rsult of FULL join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- result of no partition to join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; @@ -541,19 +541,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -584,19 +584,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 INNER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 RIGHT OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 FULL OUTER JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) ORDER BY heap_tbl_scan_test_03.SN, heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_03.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_03.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40; +EXPLAIN (COSTS OFF) SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 LEFT JOIN heap_tbl_scan_test_04 ON (heap_tbl_scan_test_03.SN = heap_tbl_scan_test_04.SN) WHERE heap_tbl_scan_test_04.SN > 40 AND heap_tbl_scan_test_03.SN > 40; -- rsult of cross join SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_scan_test_03 CROSS JOIN heap_tbl_scan_test_04 order by 1, 2; -- rsult of inner joi @@ -615,3 +615,4 @@ SELECT heap_tbl_scan_test_03.NAME, heap_tbl_scan_test_04.PHONE FROM heap_tbl_sca -- clean up DROP TABLE heap_tbl_scan_test_03; DROP TABLE heap_tbl_scan_test_04; + diff --git a/src/test/regress/sql/col_subplan_base_1.sql b/src/test/regress/sql/col_subplan_base_1.sql index 2bb47162a..1136dcb7a 100644 --- a/src/test/regress/sql/col_subplan_base_1.sql +++ b/src/test/regress/sql/col_subplan_base_1.sql @@ -6,8 +6,8 @@ set current_schema = col_distribute_subplan_base; -- Create Table and Insert Data create table t_subplan1(a1 int, b1 int, c1 int, d1 int) with (orientation = column) ; create table t_subplan2(a2 int, b2 int, c2 int, d2 int) with (orientation = column) ; -insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6 from public.src; -insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9 from public.src; +insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6; +insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9; -- 1. initplan explain (costs off) diff --git a/src/test/regress/sql/col_subplan_base_2.sql b/src/test/regress/sql/col_subplan_base_2.sql index dfc5e4a26..db16b5c79 100644 --- a/src/test/regress/sql/col_subplan_base_2.sql +++ b/src/test/regress/sql/col_subplan_base_2.sql @@ -6,8 +6,8 @@ set current_schema = col_distribute_subplan_base_2; -- Create Table and Insert Data create table t_subplan1(a1 int, b1 int, c1 int, d1 int) with (orientation = column) ; create table t_subplan2(a2 int, b2 int, c2 int, d2 int) with (orientation = column) ; -insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6 from public.src; -insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9 from public.src; +insert into t_subplan1 select generate_series(1, 100)%98, generate_series(1, 100)%20, generate_series(1, 100)%13, generate_series(1, 100)%6; +insert into t_subplan2 select generate_series(1, 50)%48, generate_series(1, 50)%28, generate_series(1, 50)%12, generate_series(1, 50)%9; create table t_subplan5 with (orientation = column) as select * from t_subplan1; create table t_subplan6 with (orientation = column) as select * from t_subplan2; @@ -152,9 +152,6 @@ explain (costs off, verbose on) select (with cte(foo) as (select a1) select foo from cte) from t_subplan1 order by 1 limit 3; select (with cte(foo) as (select a1) select foo from cte) from t_subplan1 order by 1 limit 3; explain (costs off, verbose on) -select (with cte(foo) as (select a1 from dual) select foo from cte) from t_subplan1 order by 1 limit 3; -select (with cte(foo) as (select a1 from dual) select foo from cte) from t_subplan1 order by 1 limit 3; -explain (costs off, verbose on) select (with cte(foo) as (values(b1)) values((select foo from cte))) from t_subplan1 order by 1 limit 3; select (with cte(foo) as (values(b1)) values((select foo from cte))) from t_subplan1 order by 1 limit 3; explain (costs off, verbose on) diff --git a/src/test/regress/sql/combocid.sql b/src/test/regress/sql/combocid.sql index a1f8a66df..eb5d1b468 100644 --- a/src/test/regress/sql/combocid.sql +++ b/src/test/regress/sql/combocid.sql @@ -3,7 +3,7 @@ -- -- Enforce use of COMMIT instead of 2PC for temporary objects -CREATE TEMP TABLE combocidtest (foobar int) distribute by replication; +CREATE TEMP TABLE combocidtest (foobar int); START TRANSACTION; diff --git a/src/test/regress/sql/create_index_gist.sql b/src/test/regress/sql/create_index_gist.sql index b5d0cc825..647e10b44 100644 --- a/src/test/regress/sql/create_index_gist.sql +++ b/src/test/regress/sql/create_index_gist.sql @@ -84,7 +84,7 @@ SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM fast_emp4000 WHERE home_base @ '(200,200),(2000,1000)'::box ORDER BY (home_base[0])[0]; @@ -92,83 +92,83 @@ SELECT * FROM fast_emp4000 WHERE home_base @ '(200,200),(2000,1000)'::box ORDER BY (home_base[0])[0]; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box; SELECT count(*) FROM fast_emp4000 WHERE home_base && '(1000,1000,0,0)'::box; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL; SELECT count(*) FROM fast_emp4000 WHERE home_base IS NULL; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon ORDER BY (poly_center(f1))[0]; SELECT * FROM polygon_tbl WHERE f1 ~ '((1,1),(2,2),(2,1))'::polygon ORDER BY (poly_center(f1))[0]; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) ORDER BY area(f1); SELECT * FROM circle_tbl WHERE f1 && circle(point(1,-2), 1) ORDER BY area(f1); ---EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +--EXPLAIN(COSTS OFF) --SELECT count(*) FROM gpolygon_tbl WHERE f1 && '(1000,1000,0,0)'::polygon; --SELECT count(*) FROM gpolygon_tbl WHERE f1 && '(1000,1000,0,0)'::polygon; ---EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +--EXPLAIN(COSTS OFF) --SELECT count(*) FROM gcircle_tbl WHERE f1 && '<(500,500),500>'::circle; --SELECT count(*) FROM gcircle_tbl WHERE f1 && '<(500,500),500>'::circle; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)'; SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1; SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)'; SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>'; SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; SELECT * FROM point_tbl ORDER BY f1 <-> '0,1'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 IS NULL; SELECT * FROM point_tbl WHERE f1 IS NULL; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; SELECT * FROM point_tbl WHERE f1 IS NOT NULL ORDER BY f1 <-> '0,1'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; @@ -177,7 +177,7 @@ SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_bitmapscan = ON; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; SELECT * FROM point_tbl WHERE f1 <@ '(-10,-10),(10,10)':: box ORDER BY f1 <-> '0,1'; @@ -188,4 +188,4 @@ create index i on t using gist(c_point) with (buffering=on); RESET enable_seqscan; RESET enable_indexscan; -RESET enable_bitmapscan; \ No newline at end of file +RESET enable_bitmapscan; diff --git a/src/test/regress/sql/create_index_spgist.sql b/src/test/regress/sql/create_index_spgist.sql index 3d0a1d341..518ef7b31 100644 --- a/src/test/regress/sql/create_index_spgist.sql +++ b/src/test/regress/sql/create_index_spgist.sql @@ -88,123 +88,123 @@ SET enable_seqscan = OFF; SET enable_indexscan = ON; SET enable_bitmapscan = OFF; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl; SELECT count(*) FROM quad_point_tbl; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; @@ -213,126 +213,126 @@ SET enable_seqscan = OFF; SET enable_indexscan = OFF; SET enable_bitmapscan = ON; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; SELECT count(*) FROM quad_point_tbl WHERE p IS NULL; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; SELECT count(*) FROM quad_point_tbl WHERE p IS NOT NULL; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl; SELECT count(*) FROM quad_point_tbl; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; SELECT count(*) FROM quad_point_tbl WHERE p <@ box '(200,200,1000,1000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; SELECT count(*) FROM quad_point_tbl WHERE box '(200,200,1000,1000)' @> p; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p << '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >> '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p <^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM quad_point_tbl WHERE p >^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM quad_point_tbl WHERE p ~= '(4585, 365)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; SELECT count(*) FROM kd_point_tbl WHERE p <@ box '(200,200,1000,1000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; SELECT count(*) FROM kd_point_tbl WHERE box '(200,200,1000,1000)' @> p; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p << '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p >> '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p <^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; SELECT count(*) FROM kd_point_tbl WHERE p >^ '(5000, 4000)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; SELECT count(*) FROM kd_point_tbl WHERE p ~= '(4585, 365)'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdef'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcde'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; SELECT count(*) FROM suffix_text_tbl WHERE t = 'P0123456789abcdefF'; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t < 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t ~<~ 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t <= 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t ~<=~ 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; SELECT count(*) FROM suffix_text_tbl WHERE t = 'Aztec Ct '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t = 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t >= 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t ~>=~ 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t > 'Worth St '; -EXPLAIN (NUM_NODES OFF, NODES OFF, COSTS OFF) +EXPLAIN(COSTS OFF) SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; SELECT count(*) FROM suffix_text_tbl WHERE t ~>~ 'Worth St '; RESET enable_seqscan; RESET enable_indexscan; -RESET enable_bitmapscan; \ No newline at end of file +RESET enable_bitmapscan; diff --git a/src/test/regress/sql/decode_partititon.sql b/src/test/regress/sql/decode_partititon.sql index 8629c2c30..7e47ee29a 100644 --- a/src/test/regress/sql/decode_partititon.sql +++ b/src/test/regress/sql/decode_partititon.sql @@ -24,8 +24,8 @@ CREATE TABLE tm_t_jhseatmain ( seattype character varying(2), isdefault character varying(2) ) -WITH (orientation=row, compression=no) -DISTRIBUTE BY HASH (seatid); +WITH (orientation=row, compression=no); + alter table tm_t_jhseatmain REPLICA IDENTITY FULL; CREATE INDEX tm_t_jhseatmain_seatid_idx ON tm_t_jhseatmain USING btree (seatid) TABLESPACE pg_default; -- @@ -82,7 +82,6 @@ CREATE TABLE tm_t_jhseattrack ( tasktargetid character varying(8000) ) WITH (orientation=row, compression=no) -DISTRIBUTE BY HASH (calltrackid) PARTITION BY RANGE (inserttimeforhis) ( PARTITION p_000 VALUES LESS THAN ('2018-05-01 00:00:00') TABLESPACE pg_default, diff --git a/src/test/regress/sql/domain.sql b/src/test/regress/sql/domain.sql index f023b1b2d..86e1efb84 100644 --- a/src/test/regress/sql/domain.sql +++ b/src/test/regress/sql/domain.sql @@ -506,6 +506,4 @@ drop domain testdomain3; -- create domain testdomain1 as int constraint unsigned check (value > 0); -alter domain testdomain1 rename constraint unsigned to unsigned_foo; -alter domain testdomain1 drop constraint unsigned_foo; drop domain testdomain1; diff --git a/src/test/regress/sql/hw_dynanonymous_sql.sql b/src/test/regress/sql/hw_dynanonymous_sql.sql index 37c57a917..bfacb4f79 100644 --- a/src/test/regress/sql/hw_dynanonymous_sql.sql +++ b/src/test/regress/sql/hw_dynanonymous_sql.sql @@ -961,34 +961,3 @@ end; / select * from test; drop table test; - - -CREATE OR REPLACE PROCEDURE "SP_HW_SUB_ADDMODULES" -( - returncode OUT integer, - PSV_MODULEDESC IN VARCHAR2 -) -AS -BEGIN -END SP_HW_SUB_ADDMODULES ; -/ -create or replace PROCEDURE sp_test -( -temp IN varchar2 -) -AS - PSV_SQL VARCHAR2(200); -BEGIN - PSV_SQL := 'BEGIN ' - ||'SP_HW_SUB_ADDMODULES(' - ||':1,' - ||''''||to_char(TEMP)||'''' - ||'); END;'; - dbms_output.put_line(PSV_SQL); - EXECUTE IMMEDIATE PSV_SQL; -END; -/ -call sp_test('jack'); -drop procedure SP_HW_SUB_ADDMODULES; -drop procedure sp_test; - diff --git a/src/test/regress/sql/hw_partition_scan_1.sql b/src/test/regress/sql/hw_partition_scan_1.sql index a1773701b..5577b5665 100644 --- a/src/test/regress/sql/hw_partition_scan_1.sql +++ b/src/test/regress/sql/hw_partition_scan_1.sql @@ -50,14 +50,14 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 30 ORDER BY SN; @@ -78,14 +78,14 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 30 ORDER BY SN; @@ -106,14 +106,14 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 30 ORDER BY SN; @@ -134,14 +134,14 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; --one psrtition: the first +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; --more than one partitions +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 30 ORDER BY SN; --one psrtition: the last +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE SN > 40 ORDER BY SN; -- no partition +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 ORDER BY SN; -- all partitions +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 10 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 20 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE SN < 30 ORDER BY SN; @@ -162,8 +162,8 @@ SET enable_material = OFF; SET enable_nestloop = OFF; SET enable_hashjoin = OFF; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,1)' ORDER BY SN; -EXPLAIN (COSTS OFF, NODES OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,2)' ORDER BY SN; +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,1)' ORDER BY SN; +EXPLAIN (COSTS OFF) SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,2)' ORDER BY SN; SELECT CTID , * FROM partition_scan_stu_info1 ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,1)' ORDER BY SN; SELECT SN FROM partition_scan_stu_info1 WHERE CTID = '(2,2)' ORDER BY SN; @@ -186,19 +186,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -231,19 +231,19 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -274,19 +274,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -317,19 +317,19 @@ SET enable_nestloop = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -360,19 +360,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -403,19 +403,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -448,19 +448,19 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -491,19 +491,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -534,19 +534,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -577,19 +577,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -620,19 +620,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -665,19 +665,19 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -708,19 +708,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -751,19 +751,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -794,19 +794,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -837,19 +837,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -882,19 +882,19 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -906,9 +906,9 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit -- rsult of FULL join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; @@ -929,19 +929,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -953,9 +953,9 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit -- rsult of FULL join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; @@ -976,19 +976,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1000,9 +1000,9 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit -- rsult of FULL join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; @@ -1023,19 +1023,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1066,19 +1066,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1143,19 +1143,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1188,19 +1188,19 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1212,9 +1212,9 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit -- rsult of FULL join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; @@ -1235,19 +1235,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1278,19 +1278,19 @@ SET enable_nestloop = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1302,9 +1302,9 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit -- rsult of FULL join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- result of no partition to join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; @@ -1325,19 +1325,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1368,19 +1368,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1413,19 +1413,19 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1456,19 +1456,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1499,19 +1499,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1542,19 +1542,19 @@ SET enable_mergejoin = OFF; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1585,19 +1585,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1630,19 +1630,19 @@ SET enable_hashjoin = OFF; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1673,19 +1673,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1716,19 +1716,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1759,19 +1759,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = OFF; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1802,19 +1802,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1847,19 +1847,19 @@ SET enable_hashjoin = ON; -- ---- explain cross join -- -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1890,19 +1890,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1933,19 +1933,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -1976,19 +1976,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -2019,19 +2019,19 @@ SET enable_mergejoin = ON; SET enable_hashjoin = ON; -- explain cross join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2; -- explain inner join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 INNER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain left outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain right outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 RIGHT OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain full outer join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 FULL OUTER JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) ORDER BY partition_scan_stu_info1.SN, partition_scan_stu_info1.NAME, partition_scan_stu_info1.NAME; -- explain for no partition to join -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; -EXPLAIN (COSTS OFF, NODES OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info1.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40; +EXPLAIN (COSTS OFF) SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 LEFT JOIN partition_scan_stu_info2 ON (partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) WHERE partition_scan_stu_info2.SN > 40 AND partition_scan_stu_info1.SN > 40; -- rsult of cross join SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partition_scan_stu_info1 CROSS JOIN partition_scan_stu_info2 order by 1, 2; -- rsult of inner joi @@ -2051,7 +2051,7 @@ SELECT partition_scan_stu_info1.NAME, partition_scan_stu_info2.PHONE FROM partit ---- test WITH_QUERY & EXIST & IN -- -- EXPLAIN WITH_QUERY CASE: JOIN + EXISTS PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) SELECT STU_INFO2_VIEW.SN, partition_scan_stu_info1.NAME, STU_INFO2_VIEW.PHONE FROM STU_INFO2_VIEW LEFT JOIN partition_scan_stu_info1 ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN); @@ -2064,7 +2064,7 @@ ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN) ORDER BY 1, 2, 3; -- EXPLAIN WITH_QUERY CASE: JOIN + NON PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT * FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) SELECT STU_INFO2_VIEW.SN, partition_scan_stu_info1.NAME, STU_INFO2_VIEW.PHONE FROM STU_INFO2_VIEW LEFT JOIN partition_scan_stu_info1 ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN); @@ -2076,31 +2076,31 @@ FROM STU_INFO2_VIEW LEFT JOIN partition_scan_stu_info1 ON (partition_scan_stu_info1.SN < STU_INFO2_VIEW.SN); -- EXPLAIN EXIST -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); -- RESULT OF EXIST SELECT * FROM partition_scan_stu_info1 WHERE EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) order by 1; -- EXPLAIN NOT EXIST -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2); +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2); -- RESULT OF NOT EXIST SELECT * FROM partition_scan_stu_info1 WHERE NOT EXISTS (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); -- EXPLAIN IN -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); -- RESULT OF IN SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN) order by 1; -- EXPLAIN NOT IN -EXPLAIN (COSTS OFF, NODES OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); +EXPLAIN (COSTS OFF) SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); -- RESULT OF NOT IN SELECT * FROM partition_scan_stu_info1 WHERE partition_scan_stu_info1.SN NOT IN (SELECT partition_scan_stu_info2.SN FROM partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN = partition_scan_stu_info2.SN); -- EXPLAIN WITH_QUERY CASE: EXISTS PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN < 40 ORDER BY SN ) DELETE FROM partition_scan_stu_info1 USING partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN < partition_scan_stu_info2.SN AND partition_scan_stu_info2.SN IN (SELECT SN FROM STU_INFO2_VIEW) RETURNING partition_scan_stu_info1.NAME; @@ -2114,7 +2114,7 @@ RETURNING partition_scan_stu_info1.NAME ) select * from delete_partition_scan_stu_info1_NAME order by 1; -- EXPLAIN WITH_QUERY CASE: NONE PARTITION -EXPLAIN (COSTS OFF, NODES OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) +EXPLAIN (COSTS OFF) WITH STU_INFO2_VIEW AS (SELECT SN FROM partition_scan_stu_info2 WHERE SN > 40 ORDER BY SN ) DELETE FROM partition_scan_stu_info1 USING partition_scan_stu_info2 WHERE partition_scan_stu_info1.SN < partition_scan_stu_info2.SN AND partition_scan_stu_info2.SN IN (SELECT SN FROM STU_INFO2_VIEW) RETURNING partition_scan_stu_info1.NAME; @@ -2127,4 +2127,4 @@ RETURNING partition_scan_stu_info1.NAME; -- clean up DROP TABLE partition_scan_stu_info1; -DROP TABLE partition_scan_stu_info2; \ No newline at end of file +DROP TABLE partition_scan_stu_info2; diff --git a/src/test/regress/sql/inlist2join_c.sql b/src/test/regress/sql/inlist2join_c.sql index 0401a9e21..1fa0bc670 100644 --- a/src/test/regress/sql/inlist2join_c.sql +++ b/src/test/regress/sql/inlist2join_c.sql @@ -1,93 +1,106 @@ -create schema inlist2join_c; -set current_schema=inlist2join_c; -set qrw_inlist2join_optmode=1; -create table t1(c1 int, c2 int, c3 int) with (orientation=column) distribute by hash(c1); -insert into t1 select v,v,v from generate_series(1,12) as v; -create table t2(c1 int, c2 int, c3 int) with (orientation=column) distribute by hash(c1); -insert into t2 select v,v,v from generate_series(1,10) as v; +create schema inlist2join_type_c; +set current_schema=inlist2join_type_c; +set qrw_inlist2join_optmode = cost_base; -explain (costs off) select c1,c2 from t1 where t1.c2 in (3,4,7); -select c1,c2 from t1 where t1.c2 in (3,4,7) order by 1; - -explain (costs off) select c1,c3 from t1 where t1.c2 in (3,4,7); -select c1,c3 from t1 where t1.c3 in (3,4,7) order by 1; - -explain (costs off) select c2,c3 from t1 where t1.c2 in (3,4,7); -select c2,c3 from t1 where t1.c3 in (3,4,7) order by 1; - -explain (costs off) select t1.c1 as c1, t2.c2 as c2 -from t1,t2 -where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) -order by 1,2; - -select t1.c1 as c1, t2.c2 as c2 -from t1,t2 -where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) -order by 1,2; - -explain (costs off) select * from +create table type ( - select t1.c1 as c1, t2.c2 as c2, count(*) as sum - from t1,t2 - where t1.c1 = t2.c1 - group by 1,2 -) as dt where dt.c1 in (3,4,5,6) -order by 1,2,3; + col_int TINYINT + ,col_int2 SMALLINT + ,col_int4 INTEGER + ,col_int8 BIGINT + ,col_char CHAR(20) + ,col_varchar VARCHAR(30) + ,col_num DECIMAL(10,2) + ,col_num2 NUMERIC(10,4) + ,col_float FLOAT4 + ,col_float2 FLOAT8 + ,col_float3 FLOAT(3) + ,col_float4 BINARY_DOUBLE + ,col_float5 DECIMAL(10,4) + ,col_float6 INTEGER(6,3) + ,col_bool BOOLEAN + ,col_text TEXT +)with (orientation=column); -select * from -( - select t1.c1 as c1, t2.c2 as c2, count(*) as sum - from t1,t2 - where t1.c1 = t2.c1 - group by 1,2 -) as dt where dt.c1 in (3,4,5,6) -order by 1,2,3; +insert into type values +(0, 5 , 193540, 1935401906, 'aabccd', 'aabccd', 1.20 , 10.0000, null , 1.1 , 10.1234, 321.321, 123.123654, 123.123654, true,'aabccd'), +(1, 6 , 134597, 1345971420, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), +(2, 7 , 656473, 656473370 , 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 124.123654, 123.123654, true , 'aabccd'), +(3, 8 , 126971, 1269710788, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), +(4, 9 , 115677, 1156776517, 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 123.123654, 124.123654, true , 'aabccd'), +(5, 10, 128901, 1289013296, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, true , 'abccd' ); -explain (costs off) select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; -select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; +select col_int from type where col_int in (1,2) order by 1; +explain (costs off) select col_int from type where col_int in (1,2) order by 1; +select col_int2 from type where col_int2 in (5,10) order by 1; +explain (costs off) select col_int2 from type where col_int2 in (5,10) order by 1; +select col_int4 from type where col_int4 in (134597, 134597) order by 1; +explain (costs off) select col_int4 from type where col_int4 in (134597, 134597) order by 1; +select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; +explain (costs off) select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; +select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; +explain (costs off) select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; +select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; +explain (costs off) select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; +select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; +explain (costs off) select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; +select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; +explain (costs off) select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; +select col_float from type where col_float in (1.1, 55.555) order by 1; +explain (costs off) select col_float from type where col_float in (1.1, 55.555) order by 1; +select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; +explain (costs off) select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; +select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; +explain (costs off) select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; +select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; +explain (costs off) select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; +select col_float5 from type where col_float5 in (123.123654, 123.1237) order by 1; +explain (costs off) select col_float5 from type where col_float5 in (123.123654,123.1237) order by 1; +select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; +explain (costs off) select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; +select col_bool from type where col_bool in (true, false) order by 1; +explain (costs off) select col_bool from type where col_bool in (true, false) order by 1; +select col_text from type where col_text in ('abccd', 'aab') order by 1; +explain (costs off) select col_text from type where col_text in ('abccd', 'aab') order by 1; -explain (costs off) select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; -select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; +CREATE TABLE time +( + col_int int + ,col_date date + ,col_timestamp timestamp + ,col_timestamptz timestamptz + ,col_smalldatetime smalldatetime + ,col_char char + ,col_interval interval + ,col_time time + ,col_timetz timetz + ,col_tinterval tinterval +)with (orientation=column); -select t1.c2, sum(t1.c3) from t1 where t1.c1 in (1,2,3) group by t1.c2 order by t1.c2 limit 2; -select max(t1.c2) from t1 where t1.c1 < 4 and t1.c1 in (2,3,4); -select t1.c2, t2.c3, count(*) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2; -select t1.c2, t2.c3, sum(t1.c3) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2 limit 2; +COPY time(col_int, col_date, col_timestamp, col_timestamptz, col_smalldatetime, col_char, col_interval, col_time, col_timetz, col_tinterval) FROM stdin; +3 2011-11-01 00:00:00 2017-09-09 19:45:37 2017-09-09 19:45:37 2003-04-12 04:05:06 a 2 day 13:34:56 1984-2-6 01:00:30 1984-2-6 01:00:30+8 ["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"] +6 2012-11-02 00:00:00 2017-10-09 19:45:37 2017-10-09 19:45:37 2003-04-12 04:05:07 c 1 day 18:34:56 1986-2-6 03:00:30 1986-2-6 03:00:30+8 ["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"] +7 2011-11-01 00:00:00 2017-11-09 19:45:37 2017-11-09 19:45:37 2003-04-12 04:05:08 d 1 day 13:34:56 1987-2-6 08:00:30 1987-2-6 08:00:30+8 ["epoch" "Mon May 1 00:30:30 1995"] +8 2012-11-02 00:00:00 2017-12-09 19:45:37 2017-12-09 19:45:37 2003-04-12 04:05:09 h 18 day 14:34:56 1989-2-6 06:00:30 1989-2-6 06:00:30+8 ["Feb 15 1990 12:15:03" "2001-09-23 11:12:13"] +\. -select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2) as dt order by 1; -select * from (select * from t1 union all select * from t2 where t2.c1 in (1,4,11)) as dt order by 1; -select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2 where t2.c1 in (2,3)) as dt order by 1; +select col_char from time where col_char in ('a', 'd') order by 1; +explain (costs off) select col_char from time where col_char in ('a', 'd') order by 1; +select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; +explain (costs off) select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; +select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; +explain (costs off) select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; +select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; +explain (costs off) select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; +select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; +explain (costs off) select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; +select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; +explain (costs off) select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; +select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; +explain (costs off) select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; +select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; +explain (costs off) select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; +select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; +explain (costs off) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; +drop schema inlist2join_type_c cascade; ---测试expression inlist场景 --- allow for inlist2join -explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; -select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; - -explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 * 2) in (1,2,3,4,5) order by 1; -select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 *2) in (1,2,3,4,5) order by 1; - --- disallow for inlistjoin -explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t1.c2) in (1,2,3,4,5) order by 1; -select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t2.c2) in (1,2,3,4,5) order by 1; - --- --- forbid inlist2join query rewrite if there's subplan -set qrw_inlist2join_optmode=1; -create table t3(c1 int, c2 int, c3 int) distribute by hash(c1); -insert into t3 select v,v,v from generate_series(1,10) as v; - --- the sublink can be pull up, so there is no subpaln, do inlist2join -explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 > 2) AND t1.c2 in (1,2,3); -explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 = t1.c1) and t1.c1 in (1,2,3); -explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2>2) and t1.c3 in (1,2,3); - --- the sublink can not be pull up, so there is subpaln, do not inlist2join -explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 = t1.c2) AND t1.c2 in (1,2,3); -explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 > 2) and t1.c1 in (1,2,3); -explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2=t1.c2) and t1.c3 in (1,2,3); --- - -drop table t1; -drop table t2; -drop table t3; -drop schema inlist2join_c cascade; diff --git a/src/test/regress/sql/inlist2join_type.sql b/src/test/regress/sql/inlist2join_type.sql index f1bb7506d..cea83a069 100644 --- a/src/test/regress/sql/inlist2join_type.sql +++ b/src/test/regress/sql/inlist2join_type.sql @@ -1,105 +1,94 @@ -create schema inlist2join_type; -set current_schema=inlist2join_type; -set qrw_inlist2join_optmode = 1; +create schema inlist2join_c; +set current_schema=inlist2join_c; +set qrw_inlist2join_optmode=1; +create table t1(c1 int, c2 int, c3 int) with (orientation=column); +insert into t1 select v,v,v from generate_series(1,12) as v; +create table t2(c1 int, c2 int, c3 int) with (orientation=column); +insert into t2 select v,v,v from generate_series(1,10) as v; -create table type +explain (costs off) select c1,c2 from t1 where t1.c2 in (3,4,7); +select c1,c2 from t1 where t1.c2 in (3,4,7) order by 1; + +explain (costs off) select c1,c3 from t1 where t1.c2 in (3,4,7); +select c1,c3 from t1 where t1.c3 in (3,4,7) order by 1; + +explain (costs off) select c2,c3 from t1 where t1.c2 in (3,4,7); +select c2,c3 from t1 where t1.c3 in (3,4,7) order by 1; + +explain (costs off) select t1.c1 as c1, t2.c2 as c2 +from t1,t2 +where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) +order by 1,2; + +select t1.c1 as c1, t2.c2 as c2 +from t1,t2 +where t1.c1 = t2.c1 and t1.c1 in (3,4,5,6) +order by 1,2; + +explain (costs off) select * from ( - col_int TINYINT - ,col_int2 SMALLINT - ,col_int4 INTEGER - ,col_int8 BIGINT - ,col_char CHAR(20) - ,col_varchar VARCHAR(30) - ,col_num DECIMAL(10,2) - ,col_num2 NUMERIC(10,4) - ,col_float FLOAT4 - ,col_float2 FLOAT8 - ,col_float3 FLOAT(3) - ,col_float4 BINARY_DOUBLE - ,col_float5 DECIMAL(10,4) - ,col_float6 INTEGER(6,3) - ,col_bool BOOLEAN - ,col_text TEXT -)distribute by hash(col_int); + select t1.c1 as c1, t2.c2 as c2, count(*) as sum + from t1,t2 + where t1.c1 = t2.c1 + group by 1,2 +) as dt where dt.c1 in (3,4,5,6) +order by 1,2,3; -insert into type values -(0, 5 , 193540, 1935401906, 'aabccd', 'aabccd', 1.20 , 10.0000, null , 1.1 , 10.1234, 321.321, 123.123654, 123.123654, true,'aabccd'), -(1, 6 , 134597, 1345971420, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), -(2, 7 , 656473, 656473370 , 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 124.123654, 123.123654, true , 'aabccd'), -(3, 8 , 126971, 1269710788, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, false, 'abccd' ), -(4, 9 , 115677, 1156776517, 'aabccd', 'aabccd', 1.20 , 10.0000, 1.1 , 1.1 , 10.1234, 321.321, 123.123654, 124.123654, true , 'aabccd'), -(5, 10, 128901, 1289013296, 'abccd', 'abccd' , 11.18, 1.1181 , 55.555, 55.555, 10.1234, 321.321, 123.123654, 123.123654, true , 'abccd' ); +select * from +( + select t1.c1 as c1, t2.c2 as c2, count(*) as sum + from t1,t2 + where t1.c1 = t2.c1 + group by 1,2 +) as dt where dt.c1 in (3,4,5,6) +order by 1,2,3; -select col_int from type where col_int in (1,2) order by 1; -explain (costs off) select col_int from type where col_int in (1,2) order by 1; -select col_int2 from type where col_int2 in (5,10) order by 1; -explain (costs off) select col_int2 from type where col_int2 in (5,10) order by 1; -select col_int4 from type where col_int4 in (134597, 134597) order by 1; -explain (costs off) select col_int4 from type where col_int4 in (134597, 134597) order by 1; -select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; -explain (costs off) select col_int8 from type where col_int8 in (1345971420, 1156776517) order by 1; -select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; -explain (costs off) select col_char from type where col_char in ('aabccd','aabccd', 'aab') order by 1; -select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; -explain (costs off) select col_varchar from type where col_varchar in ('abccd', 'abc','aac') order by 1; -select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; -explain (costs off) select col_num from type where col_num in (1.20, 11.18, 3,45) order by 1; -select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; -explain (costs off) select col_num2 from type where col_num2 in (1.1181, 10.0000) order by 1; -select col_float from type where col_float in (1.1, 55.555) order by 1; -explain (costs off) select col_float from type where col_float in (1.1, 55.555) order by 1; -select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; -explain (costs off) select col_float2 from type where col_float2 in (10.1234, 1.1, 11.2222) order by 1; -select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; -explain (costs off) select col_float3 from type where col_float3 in (341.321, 10.1234, 10.1114, 11.2222) order by 1; -select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; -explain (costs off) select col_float4 from type where col_float4 in (321.321, 500.123) order by 1; -select col_float5 from type where col_float5 in (123.123654, 123.1237) order by 1; -explain (costs off) select col_float5 from type where col_float5 in (123.123654,123.1237) order by 1; -select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; -explain (costs off) select col_float6 from type where col_float6 in (123.124, 113.123654) order by 1; -select col_bool from type where col_bool in (true, false) order by 1; -explain (costs off) select col_bool from type where col_bool in (true, false) order by 1; -select col_text from type where col_text in ('abccd', 'aab') order by 1; -explain (costs off) select col_text from type where col_text in ('abccd', 'aab') order by 1; +explain (costs off) select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; +select t1.c2, count(*) from t1 where t1.c1 in (1,2,3) group by t1.c2 having t1.c2 in (1,3) order by 1; -CREATE TABLE time -( - col_int int - ,col_date date - ,col_timestamp timestamp - ,col_timestamptz timestamptz - ,col_smalldatetime smalldatetime - ,col_char char - ,col_interval interval - ,col_time time - ,col_timetz timetz - ,col_tinterval tinterval -)distribute by hash(col_int); +explain (costs off) select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; +select t1.c3, t1.c2 from t1 where t1.c1 > 1 AND t1.c2 in (select t2.c2 from t2 where t2.c1 IN (3,4,5,6,7)) order by 1,2; -COPY time(col_int, col_date, col_timestamp, col_timestamptz, col_smalldatetime, col_char, col_interval, col_time, col_timetz, col_tinterval) FROM stdin; -3 2011-11-01 00:00:00 2017-09-09 19:45:37 2017-09-09 19:45:37 2003-04-12 04:05:06 a 2 day 13:34:56 1984-2-6 01:00:30 1984-2-6 01:00:30+8 ["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"] -6 2012-11-02 00:00:00 2017-10-09 19:45:37 2017-10-09 19:45:37 2003-04-12 04:05:07 c 1 day 18:34:56 1986-2-6 03:00:30 1986-2-6 03:00:30+8 ["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"] -7 2011-11-01 00:00:00 2017-11-09 19:45:37 2017-11-09 19:45:37 2003-04-12 04:05:08 d 1 day 13:34:56 1987-2-6 08:00:30 1987-2-6 08:00:30+8 ["epoch" "Mon May 1 00:30:30 1995"] -8 2012-11-02 00:00:00 2017-12-09 19:45:37 2017-12-09 19:45:37 2003-04-12 04:05:09 h 18 day 14:34:56 1989-2-6 06:00:30 1989-2-6 06:00:30+8 ["Feb 15 1990 12:15:03" "2001-09-23 11:12:13"] -\. +select t1.c2, sum(t1.c3) from t1 where t1.c1 in (1,2,3) group by t1.c2 order by t1.c2 limit 2; +select max(t1.c2) from t1 where t1.c1 < 4 and t1.c1 in (2,3,4); +select t1.c2, t2.c3, count(*) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2; +select t1.c2, t2.c3, sum(t1.c3) from t1,t2 where t1.c1 = t2.c2 and t1.c1 in (1,2,3) group by t1.c2,t2.c3 order by t1.c2 limit 2; + +select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2) as dt order by 1; +select * from (select * from t1 union all select * from t2 where t2.c1 in (1,4,11)) as dt order by 1; +select * from (select * from t1 where t1.c1 in (1,4,11) union all select * from t2 where t2.c1 in (2,3)) as dt order by 1; + +--测试expression inlist场景 +-- allow for inlist2join +explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; +select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + 2) in (1,2,3,4,5) order by 1; + +explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 * 2) in (1,2,3,4,5) order by 1; +select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c2 *2) in (1,2,3,4,5) order by 1; + +-- disallow for inlistjoin +explain (costs off) select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t1.c2) in (1,2,3,4,5) order by 1; +select t1.c1, t2.c1 from t1, t2 where t1.c1 = t2.c1 and (t1.c1 + t2.c2) in (1,2,3,4,5) order by 1; + +-- +-- forbid inlist2join query rewrite if there's subplan +set qrw_inlist2join_optmode=1; +create table t3(c1 int, c2 int, c3 int); +insert into t3 select v,v,v from generate_series(1,10) as v; + +-- the sublink can be pull up, so there is no subpaln, do inlist2join +explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 > 2) AND t1.c2 in (1,2,3); +explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 = t1.c1) and t1.c1 in (1,2,3); +explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2>2) and t1.c3 in (1,2,3); + +-- the sublink can not be pull up, so there is subpaln, do not inlist2join +explain (costs off) select * from t1 where t1.c1 in (select c1 from t2 where t2.c2 = t1.c2) AND t1.c2 in (1,2,3); +explain (costs off) select * from t1 where exists (select c1 from t2 where t2.c2 > 2) and t1.c1 in (1,2,3); +explain (costs off) select * from t1 join t2 on t1.c1=t2.c1 and t1.c1 not in (select c2 from t3 where t3.c2=t1.c2) and t1.c3 in (1,2,3); +-- + +drop table t1; +drop table t2; +drop table t3; +drop schema inlist2join_c cascade; -select col_char from time where col_char in ('a', 'd') order by 1; -explain (costs off) select col_char from time where col_char in ('a', 'd') order by 1; -select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; -explain (costs off) select col_date from time where col_date in ('2011-11-01 00:00:00', '2012-11-02 00:00:00') order by 1; -select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; -explain (costs off) select col_timestamp from time where col_timestamp in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; -select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; -explain (costs off) select col_timestamptz from time where col_timestamptz in ('2017-09-09 19:45:37', '2017-09-09 19:45:37') order by 1; -select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; -explain (costs off) select col_smalldatetime from time where col_smalldatetime in ('2017-09-09 19:45:37', '2003-04-12 04:05:06') order by 1; -select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; -explain (costs off) select col_time from time where col_time in ('08:00:30', '00:00:30', '12:00:30') order by 1; -select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; -explain (costs off) select col_timetz from time where col_timetz in ('08:00:30+08', '00:00:30+08', '12:00:30+08') order by 1; -select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; -explain (costs off) select col_interval from time where col_interval in ('2 day 13:34:56', '1 day 18:34:56') order by 1; -select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; -explain (costs off) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; -drop schema inlist2join_type cascade; diff --git a/src/test/regress/sql/inlist2join_type_c.sql b/src/test/regress/sql/inlist2join_type_c.sql index 66d4165a0..5628fc572 100644 --- a/src/test/regress/sql/inlist2join_type_c.sql +++ b/src/test/regress/sql/inlist2join_type_c.sql @@ -20,8 +20,7 @@ create table type ,col_float6 INTEGER(6,3) ,col_bool BOOLEAN ,col_text TEXT -)with (orientation=column) -distribute by hash(col_int); +)with (orientation=column); insert into type values (0, 5 , 193540, 1935401906, 'aabccd', 'aabccd', 1.20 , 10.0000, null , 1.1 , 10.1234, 321.321, 123.123654, 123.123654, true,'aabccd'), @@ -76,8 +75,7 @@ CREATE TABLE time ,col_time time ,col_timetz timetz ,col_tinterval tinterval -)with (orientation=column) -distribute by hash(col_int); +)with (orientation=column); COPY time(col_int, col_date, col_timestamp, col_timestamptz, col_smalldatetime, col_char, col_interval, col_time, col_timetz, col_tinterval) FROM stdin; 3 2011-11-01 00:00:00 2017-09-09 19:45:37 2017-09-09 19:45:37 2003-04-12 04:05:06 a 2 day 13:34:56 1984-2-6 01:00:30 1984-2-6 01:00:30+8 ["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"] @@ -105,3 +103,4 @@ explain (costs off) select col_interval from time where col_interval in ('2 day select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; explain (costs off) select col_tinterval from time where col_tinterval in ('["Sep 4, 1983 23:59:12" "Oct 4, 1983 23:59:12"]', '["May 10, 1947 23:59:12" "Jan 14, 1973 03:14:21"]') order by 1; drop schema inlist2join_type_c cascade; + diff --git a/src/test/regress/sql/magic_set.sql b/src/test/regress/sql/magic_set.sql index 2fe99a86e..ab5b2a436 100644 --- a/src/test/regress/sql/magic_set.sql +++ b/src/test/regress/sql/magic_set.sql @@ -1,9 +1,9 @@ create schema magic_set; set search_path=magic_set; -create table magic_t1(a int, b varchar, c int, d int) distribute by hash(a); -create table magic_t2(a int, b varchar, c int, d int) distribute by hash(a); -create table magic_t3(a int, b varchar, c int, d int) distribute by hash(a); +create table magic_t1(a int, b varchar, c int, d int); +create table magic_t2(a int, b varchar, c int, d int); +create table magic_t3(a int, b varchar, c int, d int); insert into magic_t1 select generate_series(1, 1000), generate_series(1, 1000), generate_series(1, 1000), generate_series(1, 1000) from public.src; insert into magic_t2 select generate_series(1, 100), generate_series(1, 200), generate_series(1, 300), generate_series(1, 500) from public.src; @@ -430,9 +430,9 @@ drop table magic_t1; drop table magic_t2; drop table magic_t3; -create table magic_t1(a int, b int, c int) distribute by hash(a); -create table magic_t2(a int, b int, c int) distribute by hash(a); -create table magic_t3(a int, b int, c int) distribute by hash(a); +create table magic_t1(a int, b int, c int); +create table magic_t2(a int, b int, c int); +create table magic_t3(a int, b int, c int); insert into magic_t1 values(1, 1, 1); insert into magic_t2 values(1, 1, 1); insert into magic_t3 values(1, 1, 1); @@ -448,10 +448,10 @@ drop table magic_t1; drop table magic_t2; drop table magic_t3; -create table magic_t1(t1_a int, t1_b varchar, t1_c int, t1_d int) distribute by hash(t1_a); -create table magic_t2(t2_a int, t2_b varchar, t2_c int, t2_d int) distribute by hash(t2_a); -create table magic_t3(t3_a int, t3_b varchar, t3_c int, t3_d int) distribute by hash(t3_a); -create table magic_t4(t4_a int, t4_b varchar, t4_c int, t4_d int) distribute by hash(t4_a); +create table magic_t1(t1_a int, t1_b varchar, t1_c int, t1_d int); +create table magic_t2(t2_a int, t2_b varchar, t2_c int, t2_d int); +create table magic_t3(t3_a int, t3_b varchar, t3_c int, t3_d int); +create table magic_t4(t4_a int, t4_b varchar, t4_c int, t4_d int); insert into magic_t1 values(generate_series(1, 100), generate_series(1, 100), generate_series(1, 100), generate_series(1, 100)); insert into magic_t2 values(generate_series(1, 30), generate_series(1, 30), generate_series(1, 30), generate_series(1, 30)); @@ -631,3 +631,4 @@ drop table magic_t3; drop table magic_t4; drop schema magic_set cascade; + diff --git a/src/test/regress/sql/security_grant.sql b/src/test/regress/sql/security_grant.sql index 5397a0c7f..37befc9dd 100644 --- a/src/test/regress/sql/security_grant.sql +++ b/src/test/regress/sql/security_grant.sql @@ -15,8 +15,6 @@ grant all on function add_func(num1 int, num2 int) to public; grant all on type bool to public; grant all on language plpgsql to public; grant all on security_t1 to public with grant option; -copy security_t1 to '/temp/copy_error'; -copy security_t1 from '/temp/copy_error'; drop function add_func(num1 int, num2 int); drop view security_v1; -drop table security_t1; \ No newline at end of file +drop table security_t1;