> On Thu, Dec 14, 2017 at 4:01 PM, Ashutosh Bapat < > ashutosh.ba...@enterprisedb.com> wrote: > >> >> + >> +-- Partial aggregation as GROUP BY clause does not match with PARTITION >> KEY >> +EXPLAIN (COSTS OFF) >> +SELECT b, sum(a), count(*) FROM pagg_tab GROUP BY b ORDER BY 1, 2, 3; >> + QUERY PLAN >> +---------------------------------------------------------------- >> + Sort >> + Sort Key: pagg_tab_p1.b, (sum(pagg_tab_p1.a)), (count(*)) >> + -> Finalize GroupAggregate >> + Group Key: pagg_tab_p1.b >> + -> Sort >> + Sort Key: pagg_tab_p1.b >> + -> Append >> + -> Partial HashAggregate >> + Group Key: pagg_tab_p1.b >> + -> Seq Scan on pagg_tab_p1 >> + -> Partial HashAggregate >> + Group Key: pagg_tab_p2_s1.b >> + -> Append >> + -> Seq Scan on pagg_tab_p2_s1 >> + -> Seq Scan on pagg_tab_p2_s2 >> + -> Partial HashAggregate >> + Group Key: pagg_tab_p3_s1.b >> + -> Append >> + -> Seq Scan on pagg_tab_p3_s1 >> + -> Seq Scan on pagg_tab_p3_s2 >> +(20 rows) >> >> Why aren't we seeing partial aggregation paths for level two and below >> partitions? >> > >> > In this version of the patch I have not recursed into next level. > Will work on it and submit changes in the next patch-set. >
Attached new set of patches adding this. Only patch 0007 (main patch) and 0008 (testcase patch) has changed. > Please have a look and let me know if I missed any. Thanks -- Jeevan Chalke Technical Architect, Product Development EnterpriseDB Corporation The Enterprise PostgreSQL Company
partition-wise-agg-v10.tar.gz
Description: GNU Zip compressed data