Re: The Future of Aggregation - Mailing list pgsql-hackers

From Andres Freund
Subject Re: The Future of Aggregation
Date
Msg-id 20150609152721.GA18593@alap3.anarazel.de
Whole thread Raw
In response to Re: The Future of Aggregation  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: The Future of Aggregation  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List 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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: The Future of Aggregation
Next
From: Andres Freund
Date:
Subject: Re: "could not adopt C locale" failure at startup on Windows