Re: SQL:2003 Window Functions for postgresql 8.3?
| От | Tom Lane |
|---|---|
| Тема | Re: SQL:2003 Window Functions for postgresql 8.3? |
| Дата | |
| Msg-id | 8467.1156445240@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: SQL:2003 Window Functions for postgresql 8.3? (Martijn van Oosterhout <kleptog@svana.org>) |
| Ответы |
Re: SQL:2003 Window Functions for postgresql 8.3?
Re: SQL:2003 Window Functions for postgresql 8.3? Re: SQL:2003 Window Functions for postgresql 8.3? |
| Список | pgsql-general |
Martijn van Oosterhout <kleptog@svana.org> writes:
> The main thing I want to use them for is for cumulative output.
> ...
> With window functions you define for each row a "window" which is from
> the beginning of the table to that row and then sum the values, for
> each row. Then you just divide by the total, nice.
Egad. Wouldn't that involve O(N) memory and O(N^2) operations?
Perhaps an extremely smart optimizer could improve this using knowledge
of the specific aggregates' behaviors, but for "black box" aggregates
it sounds pretty unworkable.
regards, tom lane
В списке pgsql-general по дате отправления: