Re: [HACKERS] Partition-wise aggregation/grouping

From: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Partition-wise aggregation/grouping
Date: 2018-03-05 08:56:41
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

On Sat, Mar 3, 2018 at 12:12 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Mar 1, 2018 at 4:52 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > This is not a full review, but I'm out of time for right now.
> Another thing I see here now is that create_grouping_paths() and
> create_child_grouping_paths() are extremely similar. Isn't there some
> way we can refactor things so that we can reuse the code instead of
> duplicating it?

Yes. I too observed the same after our re-design.

To avoid code duplication, I am now calling create_grouping_paths() for
child relation too.

However, to perform Gather or Gather Merge once we have all partial paths
ready, and to avoid too many existing code rearrangement, I am calling
try_partitionwise_grouping() before we do any aggregation/grouping on whole
relation. By doing this, we will be having all partial paths in
partially_grouped_rel and then existing code will do required finalization
along with any Gather or Gather Merge, if required.

Please have a look over attached patch-set and let me know if it needs
further changes.


> --
> Robert Haas
> EnterpriseDB:
> The Enterprise PostgreSQL Company

Jeevan Chalke
Technical Architect, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Attachment Content-Type Size
partition-wise-agg-v15.tar.gz application/gzip 29.7 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-03-05 09:01:11 Re: BUG #14999: pg_rewind corrupts control file global/pg_control
Previous Message Jeevan Chalke 2018-03-05 08:51:08 Re: [HACKERS] Partition-wise aggregation/grouping