Re: Combining Aggregates - Mailing list pgsql-hackers

From David Rowley
Subject Re: Combining Aggregates
Date
Msg-id CAApHDvq=ih-XbdYsZ6vGWE5FRoPc865vDj=oxfhnox77YoV9EQ@mail.gmail.com
Whole thread Raw
In response to Re: Combining Aggregates  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Combining Aggregates  (Kouhei Kaigai <kaigai@ak.jp.nec.com>)
Re: Combining Aggregates  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 18 December 2014 at 02:48, Simon Riggs <simon@2ndquadrant.com> wrote:

David, if you can update your patch with some docs to explain the
behaviour, it looks complete enough to think about committing it in
early January, to allow other patches that depend upon it to stand a
chance of getting into 9.5. (It is not yet ready, but I see it could
be).


Sure, I've more or less added the docs from your patch. I still need to trawl through and see if there's anywhere else that needs some additions. 
 
The above example is probably the best description of the need, since
user defined aggregates must also understand this.

Could we please call these "combine functions" or other? MERGE is an
SQL Standard statement type that we will add later, so it will be
confusing if we use the "merge" word in this context.


Ok, changed.
 
David, your patch avoids creating any mergefuncs for existing
aggregates. We would need to supply working examples for at least a
few of the builtin aggregates, so we can test the infrastructure. We
can add examples for all cases later.


In addition to MIN(), MAX(), BIT_AND(), BIT_OR, SUM() for floating point types, cash and interval. I've now added combine functions for count(*) and count(col). It seems that int8pl() is suitable for this.
 
 
Do you think it's worth adding any new functions at this stage, or is it best to wait until there's a patch which can use these?

Regards

David Rowley
Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: TODO : Allow parallel cores to be used by vacuumdb [ WIP ]
Next
From: Alvaro Herrera
Date:
Subject: Re: Role Attribute Bitmask Catalog Representation