Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype

Поиск
Список
Период
Сортировка
Искать
От
David Rowley
Тема
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype
Дата
Msg-id
CAKJS1f8Ng-ahUJKCp_7epoNh0QwBEM4YdT3ggLyXL3OdVth8xQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Robert Haas <robertmhaas@gmail.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Robert Haas <robertmhaas@gmail.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Robert Haas <robertmhaas@gmail.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype David Rowley <david.rowley@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Robert Haas <robertmhaas@gmail.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype David Rowley <david.rowley@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype David Rowley <david.rowley@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype David Rowley <david.rowley@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype David Rowley <david.rowley@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype David Rowley <david.rowley@2ndquadrant.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Noah Misch <noah@leadboat.com>
Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype Tom Lane <tgl@sss.pgh.pa.us>
On 23 June 2016 at 11:22, Tom Lane  wrote:
> While working on that, I noticed what seems to me to be a minor bug.
> The behavior that I'd expect (and that I documented) for a deserialization
> function is that it just allocates its result in the current, short-lived
> memory context, since it will be the combine function's responsibility to
> merge that into the long-lived transition state.  But it looks to me like
> the deserialization functions in numeric.c are allocating their results
> in the aggregate context, which will mean a leak.  (For example,
> numeric_avg_deserialize creates its result using makeNumericAggState
> which forces the result into the agg context.)

Yes, you're right.

In the end I decided to add a makeNumericAggStateCurrentContext()
function which does not perform any memory context switching at all.
It seems like this can be used for the combine functions too, since
they've already switched to the aggregate memory context. This should
save a few cycles during aggregate combine, and not expend any extra
as some alternatives, like adding a flag to makeNumericAggState().


-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: Amit Kapila
Дата:
Сообщение: Re: Hash Indexes
От: Michael Paquier
Дата:
FAQ