Re: Rethinking representation of partial-aggregate steps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Rethinking representation of partial-aggregate steps
Дата
Msg-id 24924.1466955395@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Rethinking representation of partial-aggregate steps  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: Rethinking representation of partial-aggregate steps  (David Rowley <david.rowley@2ndquadrant.com>)
Re: Rethinking representation of partial-aggregate steps  (David Rowley <david.rowley@2ndquadrant.com>)
Список pgsql-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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Rename max_parallel_degree?
Следующее
От: Andrey Zhidenkov
Дата:
Сообщение: Re: Memory leak in Pl/Python