Re: The Future of Aggregation

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: The Future of Aggregation
Date: 2015-06-09 15:27:21
Message-ID: 20150609152721.GA18593@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-06-09 17:19:33 +0200, Tomas Vondra wrote:
> ... and yet another use case for 'aggregate state combine' that I just
> remembered about is grouping sets. What GROUPING SET (ROLLUP, ...) do
> currently is repeatedly sorting the input, once for each grouping.

Actually, that's not really what happens. All aggregates that share a
sort order are computed in parallel. Only when sets do not share an
order additional sorts are required.

> What
> could happen in some cases is building the most detailed aggregation first,
> then repeatedly combine these partial states.

I'm not sure that'll routinely be beneficial, because it'd require
keeping track of all the individual "most detailed" results, no?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-06-09 15:37:21 Re: "could not adopt C locale" failure at startup on Windows
Previous Message Alvaro Herrera 2015-06-09 15:25:43 Re: The Future of Aggregation