提交 6749ed4c 编写于 作者: V Venkatesh Raghavan

Remove residual FIXME from window merge work

During window merge, DQA was temporarily disabled with GPORCA.
After the following PR, this was resolved. In this PR, I am cleaning a
residual outdated fixme

https://github.com/greenplum-db/gpdb/pull/4086

The string_agg function was categorized as ordered window aggregate in
GPDB 5. So GPORCA did not support that and fallbacks to planner. In GPDB
6 string_agg is a straightforward window aggregate, so GPORCA supports
it.
上级 de5792ee
......@@ -1570,6 +1570,24 @@ select array_agg(a order by b desc nulls last) from aggordertest;
{NULL,3,1,2,1,2}
(1 row)
-- begin MPP-14125: if prelim function is missing, do not choose hash agg.
create temp table mpp14125 as select repeat('a', a) a, a % 10 b from generate_series(1, 100)a;
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column(s) named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
explain select string_agg(a) from mpp14125 group by b;
QUERY PLAN
------------------------------------------------------------------------------------------------------
Gather Motion 2:1 (slice2; segments: 2) (cost=8.32..9.20 rows=5 width=36)
-> GroupAggregate (cost=8.32..9.20 rows=5 width=36)
Group By: b
-> Sort (cost=8.32..8.57 rows=50 width=55)
Sort Key: b
-> Redistribute Motion 2:2 (slice1; segments: 2) (cost=0.00..5.00 rows=50 width=55)
Hash Key: b
-> Seq Scan on mpp14125 (cost=0.00..3.00 rows=50 width=55)
(8 rows)
-- end MPP-14125
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
......@@ -1569,6 +1569,25 @@ select array_agg(a order by b desc nulls last) from aggordertest;
{NULL,3,1,2,1,2}
(1 row)
-- begin MPP-14125: if prelim function is missing, do not choose hash agg.
create temp table mpp14125 as select repeat('a', a) a, a % 10 b from generate_series(1, 100)a;
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause. Creating a NULL policy entry.
explain select string_agg(a) from mpp14125 group by b;
QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.07 rows=10 width=8)
-> Result (cost=0.00..431.07 rows=4 width=8)
-> GroupAggregate (cost=0.00..431.07 rows=4 width=8)
Group Key: b
-> Sort (cost=0.00..431.06 rows=34 width=55)
Sort Key: b
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.01 rows=34 width=55)
Hash Key: b
-> Table Scan on mpp14125 (cost=0.00..431.00 rows=34 width=55)
Optimizer: PQO version 2.55.0
(10 rows)
-- end MPP-14125
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
......@@ -6021,22 +6021,6 @@ select sum((select prc from sale where cn = s.cn and vn = s.vn and pn = s.pn)) f
(1 row)
-- end MPP-14021
-- begin MPP-14125: if prelim function is missing, do not choose hash agg.
create temp table mpp14125 as select repeat('a', a) a, a % 10 b from generate_series(1, 100)a;
explain select string_agg(a) from mpp14125 group by b;
QUERY PLAN
------------------------------------------------------------------------------------------------------
Gather Motion 2:1 (slice2; segments: 2) (cost=8.32..9.20 rows=5 width=36)
-> GroupAggregate (cost=8.32..9.20 rows=5 width=36)
Group By: b
-> Sort (cost=8.32..8.57 rows=50 width=55)
Sort Key: b
-> Redistribute Motion 2:2 (slice1; segments: 2) (cost=0.00..5.00 rows=50 width=55)
Hash Key: b
-> Seq Scan on mpp14125 (cost=0.00..3.00 rows=50 width=55)
(8 rows)
-- end MPP-14125
-- Test COUNT in a subquery
create table prod_agg (sale integer, prod varchar);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'sale' as the Greenplum Database data distribution key for this table.
......
......@@ -1386,7 +1386,10 @@ select array_agg(a order by b nulls last) from aggordertest;
select array_agg(a order by b desc nulls first) from aggordertest;
select array_agg(a order by b desc nulls last) from aggordertest;
-- begin MPP-14125: if prelim function is missing, do not choose hash agg.
create temp table mpp14125 as select repeat('a', a) a, a % 10 b from generate_series(1, 100)a;
explain select string_agg(a) from mpp14125 group by b;
-- end MPP-14125
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
......@@ -138,11 +138,6 @@ select cn, vn, pn, sum(qty*prc) from sale group by cube (cn, vn, pn) order by 1,
select cn, vn, pn, sum(qty*prc) from sale group by grouping sets ((), (cn), (vn), (pn), (cn,vn), (cn,pn), (vn,pn), (cn,vn,pn)) order by 1,2,3; -- order 1,2,3
--end_equiv
-- start_ignore
-- GPDB_84_MERGE_FIXME: ORCA started supporting this feature, investigate why
set optimizer = off;
-- end_ignore
-- ***BUG*** The extended groupings aren't correctly ordered! Maybe they wrongly parallel sorted!
--start_equiv order 1,2,3
select cn, vn, pn, count(distinct dt) from sale group by cn, vn, pn
......@@ -177,9 +172,6 @@ order by 1,2,3; -- order 1,2,3
select cn, vn, pn, count(distinct dt) from sale group by cube (cn, vn, pn) order by 1,2,3; -- order 1,2,3
select cn, vn, pn, count(distinct dt) from sale group by grouping sets ((), (cn), (vn), (pn), (cn,vn), (cn,pn), (vn,pn), (cn,vn,pn)) order by 1,2,3; -- order 1,2,3
--end_equiv
-- start_ignore
reset optimizer;
-- end_ignore
-- Ordinary Grouping Set Specifications --
......@@ -603,18 +595,6 @@ drop table s6756 cascade; --ignore
select sum((select prc from sale where cn = s.cn and vn = s.vn and pn = s.pn)) from sale s;
-- end MPP-14021
-- begin MPP-14125: if prelim function is missing, do not choose hash agg.
create temp table mpp14125 as select repeat('a', a) a, a % 10 b from generate_series(1, 100)a;
-- start_ignore
-- GPDB_84_MERGE_FIXME: ORCA started supporting this feature, investigate why
set optimizer = off;
-- end_ignore
explain select string_agg(a) from mpp14125 group by b;
-- start_ignore
reset optimizer;
-- end_ignore
-- end MPP-14125
-- Test COUNT in a subquery
create table prod_agg (sale integer, prod varchar);
insert into prod_agg values
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册