Re: [HACKERS] Standard Deviation function.
От | Bruce Momjian |
---|---|
Тема | Re: [HACKERS] Standard Deviation function. |
Дата | |
Msg-id | 199806050155.VAA07828@candle.pha.pa.us обсуждение исходный текст |
Ответ на | RE: [HACKERS] Standard Deviation function. ("Stupor Genius" <stuporg@erols.com>) |
Ответы |
RE: [HACKERS] Standard Deviation function.
|
Список | pgsql-hackers |
> > > I really need a Standard Deviation aggregate function... > > > > I know about the man pages for "create aggregate" and "create > > function". Is there something else I should look at? > > > > 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. > > > > Any hints or advice?? > > I thought about this a long time ago and had an idea but never > got around to trying to implement it. I was going to have some > functions that worked on a structure of two doubles to track > the sum and square instead of using only one simple type. I remember talking about this to someone, and the problem is that you needed the average WHILE scanning through the table, which required two passes, which the aggregate system is not designed to do. I may be wrong on this, though. -- Bruce Momjian | 830 Blythe Avenue maillist@candle.pha.pa.us | Drexel Hill, Pennsylvania 19026 + If your life is a hard drive, | (610) 353-9879(w) + Christ can be your backup. | (610) 853-3000(h)
В списке pgsql-hackers по дате отправления: