I would like to request a new aggregate function for
I need an aggregate function that calculates geometric
mean, and can be used in SQL statements the same as
any other aggregate function such as count(), sum()
and avg(). Rather than have a custom function, I'd
like to see it added as a standard PostgreSQL feature.
Is there a specific PostgreSQL developer that I should
contact? Or is an open request on this list
sufficient for consideration?
The geometric mean function, I'll call it gmean(), is
similar to avg(), except that instead of adding the
individual values, you would multiply them; and
instead of dividing the sum by the sample size, you
would raise the resulting product by a power of (1 /
Therefore, the gmean() of the values 1, 2, 3 and 9
= (1 * 2 * 3 * 9) ^ (1 / 4)
= 54 ^ 0.25
= 2.710806 # rounded to 6 decimal places
This function differs from arithmetic mean (average)
in that it lessens the affect of outliers without
discounting them altogether.
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
pgsql-general by date
|Next:||From: postgres||Date: 2002-04-26 13:36:56|
|Subject: intel vs amd benchmark for pg server|
|Previous:||From: webmaster||Date: 2002-04-26 12:50:53|
|Subject: delete column|