Re: proposal: tuplestore, tuplesort aggregate functions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: proposal: tuplestore, tuplesort aggregate functions
Date
Msg-id AANLkTimxvTRy1Z3eBkzuPtaLsBHuoEooDZkTCpmXt9a=@mail.gmail.com
Whole thread Raw
In response to Re: proposal: tuplestore, tuplesort aggregate functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal: tuplestore, tuplesort aggregate functions
List pgsql-hackers
On Thu, Aug 19, 2010 at 4:21 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> You've made this assertion at least three times now, but I confess
>> that I've only ever learned one way to compute a median; and quick
>> Google searches for "median", "kinds of median", and few other
>> variants failed to turn up anything obvious either.
>
> There are different ways to define it when the number of samples is even.
> However I believe that "use the mean of the two middle values" is much
> the most common way to deal with that.

I suppose there could also be a bit of an ambiguity if you're working
with a type like int4 where the values are discrete steps.  Like, what
do you do with {1, 2}?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: proposal: tuplestore, tuplesort aggregate functions
Next
From: "Kevin Grittner"
Date:
Subject: Re: proposal: tuplestore, tuplesort aggregate functions