Re: Combining Aggregates

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Combining Aggregates
Дата
Msg-id CAKJS1f-Xc2a2y52+c+_SoC-Ki=XfHxHLz2raFOm4bgi_iMqyiQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Combining Aggregates  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: Combining Aggregates  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
On 16 March 2016 at 10:34, David Rowley <david.rowley@2ndquadrant.com> wrote:
> If Haribabu's patch does all that's required for the numerical
> aggregates for floating point types then the status of covered
> aggregates is (in order of pg_aggregate.h):
>
> * AVG() complete coverage
> * SUM() complete coverage
> * MAX() complete coverage
> * MIN() complete coverage
> * COUNT() complete coverage
> * STDDEV + friends complete coverage
> * regr_*,covar_pop,covar_samp,corr not touched these.
> * bool*() complete coverage
> * bitwise aggs. complete coverage
> * Remaining are not touched. I see diminishing returns with making
> these parallel for now. I think I might not be worth pushing myself
> any harder to make these ones work.
>
> Does what I have done + floating point aggs from Haribabu seem
> reasonable for 9.6?

I've attached a series of patches.

Patch 1:
This is the parallel aggregate patch, not intended for review here.
However, all further patches are based on this, and this adds the
required planner changes to make it possible to test patches 2 and 3.

Patch 2:
This adds the serial/deserial aggregate infrastructure, pg_dump
support, CREATE AGGREGATE changes, and nodeAgg.c changes to have it
serialise and deserialise aggregate states when instructed to do so.

Patch 3:
This adds a boat load of serial/deserial functions, and combine
functions for most of the built-in numerical aggregate functions. It
also contains some regression tests which should really be in patch 2,
but I with patch 2 there's no suitable serialisation or
de-serialisation functions to test CREATE AGGREGATE with. I think
having them here is ok, as patch 2 is quite useless without patch 3
anyway.

Another thing to note about this patch is that I've gone and created
serial/de-serial functions for when PolyNumAggState both require
sumX2, and don't require sumX2. I had thought about perhaps putting an
extra byte in the serial format to indicate if a sumX2 is included,
but I ended up not doing it this way. I don't really want these serial
formats getting too complex as we might like to do fun things like
pass them along to sharded servers one day, so it might be nice to
keep them simple.

Patch 4:
Adds a bunch of opr_sanity regression tests. This could be part of
patch 3, but 3 was quite big already.

Patch 5:
Adds some documentation to indicate which aggregates allow partial mode.

Comments welcome.

--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Вложения

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

Предыдущее
От: Haribabu Kommi
Дата:
Сообщение: Re: Combining Aggregates
Следующее
От: David Rowley
Дата:
Сообщение: Re: Combining Aggregates