Re: [HACKERS] Partition-wise aggregation/grouping
| От | Jeevan Chalke |
|---|---|
| Тема | Re: [HACKERS] Partition-wise aggregation/grouping |
| Дата | |
| Msg-id | CAM2+6=XsyG3=FRYePc6YBZ3VFJ9BRx66V-eBO257oC0d6F6bNQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: [HACKERS] Partition-wise aggregation/grouping (Jeevan Chalke <jeevan.chalke@enterprisedb.com>) |
| Ответы |
Re: [HACKERS] Partition-wise aggregation/grouping
|
| Список | pgsql-hackers |
On Thu, Dec 14, 2017 at 4:01 PM, Ashutosh Bapat <ashutosh.bapat@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
Technical Architect, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
Вложения
В списке pgsql-hackers по дате отправления: