Re: wip: functions median and percentile - Mailing list pgsql-hackers

From Hitoshi Harada
Subject Re: wip: functions median and percentile
Date
Msg-id AANLkTikYR9p71=K=6ZktDU0va9StCV2TsuOzS9NDbW45@mail.gmail.com
Whole thread Raw
In response to Re: wip: functions median and percentile  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: wip: functions median and percentile
List pgsql-hackers
2010/10/2 Tom Lane <tgl@sss.pgh.pa.us>:
> Hitoshi Harada <umi.tanuki@gmail.com> writes:
>> Another suggestion?
>
> 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. The nearest pattern was array_agg() which uses
on-memory state and throw its responsibility to clear memory to
executor (nodeAgg / nodeWindowAgg). Am I missing something?

Regards,


-- 
Hitoshi Harada


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: wip: functions median and percentile
Next
From: Tom Lane
Date:
Subject: Re: wip: functions median and percentile