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

Re: wip: functions median and percentile

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-03 15:49:37
Message-ID: AANLkTimMoQpzCoL1OLASh0B5KPOG8tAm-3y=PhxbZS4y@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-rrreviewers
On Sun, Oct 3, 2010 at 7:06 AM, Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> wrote:
> And I'm now thinking about how to make median happen in window
> aggregate.

If you were to do this by extending tuplesort what extra features
would tuplesort need?

Would tuplesort need the ability to insert additional records into an
already sorted array and maintain the sort?
Would it need the ability to remove records from the sorted set?
Would it need the ability to do a partial sort (the QuickSelect algorithm)?
The ability to do random access on disk sets?

How do existing windowed aggregates work if you specify an order by on
the aggregate? Do they resort for every output row?

Does the spec give a way to run an arbitrary subselect on the current
window? I wonder if we need more powerful machinery anyways to handle
these cases.

-- 
greg

In response to

Responses

pgsql-hackers by date

Next:From: Bernd HelmleDate: 2010-10-03 17:05:42
Subject: ALTER DATABASE RENAME with HS/SR
Previous:From: Tom LaneDate: 2010-10-03 15:29:12
Subject: Re: Heads up: upcoming back-branch releases

pgsql-rrreviewers by date

Next:From: Pavel StehuleDate: 2010-10-03 17:31:18
Subject: Re: wip: functions median and percentile
Previous:From: Hitoshi HaradaDate: 2010-10-03 14:06:25
Subject: Re: wip: functions median and percentile

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