Skip site navigation (1) Skip section navigation (2)

Re: wip: functions median and percentile

From: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wip: functions median and percentile
Date: 2010-10-01 15:16:03
Message-ID: AANLkTikYR9p71=K=6ZktDU0va9StCV2TsuOzS9NDbW45@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
2010/10/2 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Thom BrownDate: 2010-10-01 15:20:00
Subject: Re: recovery.conf location
Previous:From: Kevin GrittnerDate: 2010-10-01 15:15:03
Subject: Re: wip: functions median and percentile

pgsql-rrreviewers by date

Next:From: Tom LaneDate: 2010-10-01 15:22:46
Subject: Re: wip: functions median and percentile
Previous:From: Kevin GrittnerDate: 2010-10-01 15:15:03
Subject: Re: wip: functions median and percentile

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group