Re: upper planner path-ification

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: upper planner path-ification
Date: 2015-06-23 05:05:32
Message-ID: CAKJS1f_m8m=31noDxcsv2mAxZu1d8bqN43m7fjf-tXPtTX=uSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23 June 2015 at 13:55, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com> wrote:

> Once we support to add aggregation path during path consideration,
> we need to pay attention morphing of the final target-list according
> to the intermediate path combination, tentatively chosen.
> For example, if partial-aggregation makes sense from cost perspective;
> like SUM(NRows) of partial COUNT(*) AS NRows instead of COUNT(*) on
> billion rows, planner also has to adjust the final target-list according
> to the interim paths. In this case, final output shall be SUM(), instead
> of COUNT().
>
>
This sounds very much like what's been discussed here:

http://www.postgresql.org/message-id/CA+U5nMJ92azm0Yt8TT=hNxFP=VjFhDqFpaWfmj+66-4zvCGv3w@mail.gmail.com

The basic concept is that we add another function set to aggregates that
allow the combination of 2 states. For the case of MIN() and MAX() this
will just be the same as the transfn. SUM() is similar for many types, more
complex for others. I've quite likely just borrowed SUM(BIGINT)'s transfer
functions to allow COUNT()'s to be combined.

More time does need spent inventing the new combining functions that don't
currently exist, but that shouldn't matter as it can be done later.

Commitfest link to patch here https://commitfest.postgresql.org/5/131/

I see you've signed up to review it!

Regards

David Rowley

--
David Rowley http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Keith Fiske 2015-06-23 05:06:08 Re: 9.5 make world failing due to sgml tools missing
Previous Message Fabien COELHO 2015-06-23 04:59:42 Re: checkpointer continuous flushing