Re: wip: functions median and percentile

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: wip: functions median and percentile
Дата
Msg-id AANLkTi=xJn+nPK3fw2zCuHj1wdRbJBvcYGdAxYLpgU9S@mail.gmail.com
обсуждение исходный текст
Ответ на Re: wip: functions median and percentile  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: wip: functions median and percentile  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: wip: functions median and percentile  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
2010/9/22 Pavel Stehule <pavel.stehule@gmail.com>:
> Hello
>
> I found probably hard problem in cooperation with window functions :(
>
> tuplesort_begin_datum creates child context inside aggcontext. This
> context is used for tuplestore. But when this function is called from
> WindowAgg_Aggregates context - someone drops all child context every
> iteration, and then tuplestore state is invalid. For this moment we
> can block using a median function as window function, but it should be
> solved better - if it is possible - I don't see inside window function
> implementation.

Does it happen when the window frame starts from not UNBOUNDED
PRECEDING? In those cases, nodeWindowAgg tries to discard all
aggregate contexts and to initialize the aggregate state. AFAIK the
memory context is brand-new although it was reset and its children
deleted, so if the function is well-formed and initializes its state
on NULL input, it doesn't cause a problem.


Regards,


-- 
Hitoshi Harada


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Multi-branch committing in git, revisited
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Multi-branch committing in git, revisited