requesting features in PostgreSQL
От | Andrew Gould |
---|---|
Тема | requesting features in PostgreSQL |
Дата | |
Msg-id | 20020426125430.62788.qmail@web13408.mail.yahoo.com обсуждение исходный текст |
Ответы |
Re: requesting features in PostgreSQL
|
Список | pgsql-general |
I would like to request a new aggregate function for PostgreSQL. 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 / sample size). Therefore, the gmean() of the values 1, 2, 3 and 9 would equal: = (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. Thanks, Andrew Gould __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/
В списке pgsql-general по дате отправления: