From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Rethinking representation of partial-aggregate steps
Date: Sun, 26 Jun 2016 11:36:35 -0400
Message-ID: <24924.1466955395@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f_Rh6=32CLZobNCbjr7GsBr1vD0BHrY=ZO=sBSdGu3v0g@mail.gmail.com>
References: <20160623173851.GA203183@alvherre.pgsql>
<32396.1466704522@sss.pgh.pa.us>
<CAKJS1f-vriv6hm7oCBXb+NyifwnrGYybVPZtiMwKRdFoECZbuw@mail.gmail.com>
<1019.1466870211@sss.pgh.pa.us>
<1473.1466870870@sss.pgh.pa.us>
<CAKJS1f_Rh6=32CLZobNCbjr7GsBr1vD0BHrY=ZO=sBSdGu3v0g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
David Rowley <david.rowley@2ndquadrant.com> writes:
> On 26 June 2016 at 04:07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> After a bit of thought, maybe AggDivision or AggSplit or something
>> along those lines?
> How about AggCompletion? It's seems to fit well in the sense of the
> aggregation being partial or not, but less well when you consider
> serialisation and combining states.
After having worked on the patch some, I think that AggSplit is a pretty
good choice, because it is about how we split up the calculation of an
aggregate. And it's short, which is a good thing for something that's
going to be a component of assorted names.
What I've got at the moment looks like:
/* Primitive options supported by nodeAgg.c: */
#define AGGSPLITOP_COMBINE 0x1 /* substitute combinefn for transfn */
#define AGGSPLITOP_SERIALIZE 0x2 /* apply serializefn to output */
#define AGGSPLITOP_DESERIALIZE 0x4 /* apply deserializefn to input */
#define AGGSPLITOP_FINALIZE 0x8 /* run finalfn */
/* Supported operating modes (i.e., useful combinations of these options): */
typedef enum AggSplit
{
/* Basic, non-split aggregation: */
AGGSPLIT_SIMPLE = AGGSPLITOP_FINALIZE,
/* Initial phase of partial aggregation, with serialization: */
AGGSPLIT_PARTIAL_SERIAL = AGGSPLITOP_SERIALIZE,
/* Final phase of partial aggregation, with deserialization: */
AGGSPLIT_FINAL_DESERIAL = AGGSPLITOP_COMBINE | AGGSPLITOP_DESERIALIZE | AGGSPLITOP_FINALIZE
} AggSplit;
/* Test macros for the primitive options: */
#define DO_AGGSPLIT_COMBINE(as) (((as) & AGGSPLITOP_COMBINE) != 0)
#define DO_AGGSPLIT_SERIALIZE(as) (((as) & AGGSPLITOP_SERIALIZE) != 0)
#define DO_AGGSPLIT_DESERIALIZE(as) (((as) & AGGSPLITOP_DESERIALIZE) != 0)
#define DO_AGGSPLIT_FINALIZE(as) (((as) & AGGSPLITOP_FINALIZE) != 0)
Looking at this in the light of morning, I'm rather strongly tempted to
invert the sense of the FINALIZE option, so that "simple" mode works out
as zero, ie, select no options. Maybe call it SKIPFINAL instead of
FINALIZE?
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, alvherre@2ndquadrant.com, robertmhaas@gmail.com
Subject: Re: Rethinking representation of partial-aggregate steps
In-Reply-To: <24924.1466955395@sss.pgh.pa.us>
References: <20160623173851.GA203183@alvherre.pgsql> <32396.1466704522@sss.pgh.pa.us> <CAKJS1f-vriv6hm7oCBXb+NyifwnrGYybVPZtiMwKRdFoECZbuw@mail.gmail.com> <1019.1466870211@sss.pgh.pa.us> <1473.1466870870@sss.pgh.pa.us> <CAKJS1f_Rh6=32CLZobNCbjr7GsBr1vD0BHrY=ZO=sBSdGu3v0g@mail.gmail.com> <24924.1466955395@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox