Re: [GENERAL] Median, Quartile and Percentile Aggregate Functions - Mailing list pgsql-general

From Ed Loehr
Subject Re: [GENERAL] Median, Quartile and Percentile Aggregate Functions
Date
Msg-id 38BFC7A1.3343FFEC@austin.rr.com
Whole thread Raw
In response to Median, Quartile and Percentile Aggregate Functions  (Patrik Hall <phall@phall.kdsoft.fi>)
List pgsql-general
Patrik Hall wrote:
>
> I am in need of median, quartile and percentile functions in postgres.
>
> Has anybody implemented any of them allready?
>
> I have the functions temporary solved in PHP right now but they are really
> slow as datarows are increasing in count.

I don't know much about php, but there is a perl stats module called
Statistics::Descriptive, available at CPAN, that has what you seek and
seems pretty quick (I haven't measured it).  I find that doing these
sorts of functions in perl tends overall to be faster than doing them
in postgres, though that would not be my intuition.

Cheers,
Ed Loehr

pgsql-general by date:

Previous
From: Emmanuel DISCORS
Date:
Subject: Re: [GENERAL] Postgres on MacOS... Is it even a possibility?
Next
From: "Chris Carbaugh"
Date:
Subject: Help with installing 6.5.3 on RedHat6.1 - specifying template