Re: Combining Aggregates - Mailing list pgsql-hackers

From David Rowley
Subject Re: Combining Aggregates
Date
Msg-id CAApHDvoPZFuzvvOQXOM2oDxyuUC7Y=g+5Oyz3jMtKpsGT0fU-A@mail.gmail.com
Whole thread Raw
In response to Re: Combining Aggregates  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 25 February 2015 at 08:15, Peter Eisentraut <peter_e@gmx.net> wrote:
On 2/20/15 3:32 PM, Tomas Vondra wrote:

> Also, there are aggregate functions like array_agg() or string_agg()
> that make this impossible, just like for many custom aggregates (like
> hyperloglog for example). Again, I might not understand the idea
> correctly ...

How would a combining function work for something like array_agg()?  I
don't think it would, at least if you want to preserve the ordering
option for the user.


They just wouldn't work in that case. We'd simply not have a combine function for that aggregate.

The yet to be written code, (say parallel hash aggregate), the planner would have to ensure that each aggregate function being used had a combine function, if any aggregate in the current query level didn't have one then it would not parallelise the query.

Regards

David Rowley

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Performance improvement for joins where outer side is unique
Next
From: Etsuro Fujita
Date:
Subject: Re: Join push-down support for foreign tables