Re: wip: functions median and percentile

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема Re: wip: functions median and percentile
Дата
Msg-id AANLkTimAgJ5aqC6co-65Adr=xzax+4_0aZLozaAaXmbS@mail.gmail.com
обсуждение исходный текст
Ответ на Re: wip: functions median and percentile  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: wip: functions median and percentile  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
2010/10/2 Tom Lane <tgl@sss.pgh.pa.us>:
> Hitoshi Harada <umi.tanuki@gmail.com> writes:
>> 2010/10/2 Tom Lane <tgl@sss.pgh.pa.us>:
>>> The implementation I would've expected to see is to do the sort and then
>>> have two code paths for retrieving the median, depending on whether the
>>> sort result is all in memory or not.
>
>> Hm? The problem we encountered in the middle of the patch is there is
>> no chance to call tuplesort_end if median is called in moving frame
>> window aggregate because final function is called multiple times
>> during moving.
>
> Well, if you haven't got a solution for that, then this patch isn't
> ready for prime time.
>
> It's entirely possible that median as a window function is intractable.
> I'd rather have it throwing error than offer an implementation that will
> fall over as soon as the window gets large.

Well, that sounds like the conclusion. It is a shame, but we have to
throw an error from median() in the window aggregate, if Pavel does
not have any better solution. And as an aggregate function only, the
patch is ready if the window-related parts are removed.

Regards,


-- 
Hitoshi Harada


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: So git pull is shorthand for what exactly?
Следующее
От: Hitoshi Harada
Дата:
Сообщение: Re: wip: functions median and percentile