Standard Deviation function.

Поиск
Список
Период
Сортировка
От Chris Albertson
Тема Standard Deviation function.
Дата
Msg-id 357747F2.A256B26C@topdog.logicon.com
обсуждение исходный текст
Ответы RE: [HACKERS] Standard Deviation function.  ("Stupor Genius" <stuporg@erols.com>)
Список pgsql-hackers
Hello,

I really need a Standard Deviation aggregate function so I will
try to write one.

I know about the man pages for "create aggregate" and "create
function".  Is there something else I should look at?
Just a few pointers could save me a few hours of hunting around.
All advice accepted.

It seems kind of hard to do with only two state functions unless
I "cheat".  I need to keep three values, Count, Sum, and Sum of
Squares.  I could use three static variables and have the final
function ignore its input and use the static vars instead.  This
will likely blow up if the new Standard Deviation aggregate is
used twice in the same select.

Any hints or advice??

If someone has this done already let me know.

I may want do a "median" aggregate function too as I'll need that
later.  This would require private storage and a sort.

Could you cc me at both addresses below as I move around between
them

Thanks,

--
--Chris Albertson

  chrisja@jps.net
  chris@topdog.logicon.com                Voice:  626-351-0089  X127
                                            Fax:  626-351-0699

В списке pgsql-hackers по дате отправления:

Предыдущее
От: fue48@hk.super.net (USA Publishing Co.)
Дата:
Сообщение: Wanted Home Product Assemblers
Следующее
От: "Stupor Genius"
Дата:
Сообщение: RE: [HACKERS] Standard Deviation function.