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

Re: wip: functions median and percentile

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
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:22:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-rrreviewers
Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> writes:
> 2010/10/2 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2010-10-01 15:27:25
Subject: So git pull is shorthand for what exactly?
Previous:From: Thom BrownDate: 2010-10-01 15:20:00
Subject: Re: recovery.conf location

pgsql-rrreviewers by date

Next:From: Hitoshi HaradaDate: 2010-10-01 15:32:03
Subject: Re: wip: functions median and percentile
Previous:From: Hitoshi HaradaDate: 2010-10-01 15:16:03
Subject: Re: wip: functions median and percentile

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