Re: Final Patch for GROUPING SETS

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Greg Sabino Mullane <greg(at)turnstep(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tv(at)fuzzy(dot)cz>
Subject: Re: Final Patch for GROUPING SETS
Date: 2014-12-22 19:40:26
Message-ID: CAOeZVid-wruEF3NJgtag24uJnYCQ4TG_rMQCpGZnXfEqV86ODQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday, December 23, 2014, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Mon, Dec 22, 2014 at 11:19 AM, Andrew Gierth
> <andrew(at)tao11(dot)riddles(dot)org(dot)uk <javascript:;>> wrote:
> > Tom> The other reason that's a bad comparison is that I've not seen
> > Tom> many queries that use more than a couple of window frames,
> > Tom> whereas we have to expect that the number of grouping sets in
> > Tom> typical queries will be significantly more than "a couple".
> >
> > I would be interested in seeing more good examples of the size and
> > type of grouping sets used in typical queries.
>
> From what I have seen, there is interest in being able to do things
> like GROUP BY CUBE(a, b, c, d) and have that be efficient. That will
> require 16 different groupings, and we really want to minimize the
> number of times we have to re-sort to get all of those done. For
> example, if we start by sorting on (a, b, c, d), we want to then make
> a single pass over the data computing the aggregates with (a, b, c,
> d), (a, b, c), (a, b), (a), and () as the grouping columns.
>
>
>
That is what ChainAggregate node does exactly. A set of orders that fit in
a single ROLLUP list (like your example) are processed in a single go.

--
Regards,

Atri
*l'apprenant*

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2014-12-22 20:21:58 Re: TABLESAMPLE patch
Previous Message Robert Haas 2014-12-22 19:38:28 Re: Final Patch for GROUPING SETS