Re: OLAP, Aggregates, and order of operations
От | Tom Lane |
---|---|
Тема | Re: OLAP, Aggregates, and order of operations |
Дата | |
Msg-id | 4315.998584195@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | OLAP, Aggregates, and order of operations (mlw <markw@mohawksoft.com>) |
Список | pgsql-hackers |
mlw <markw@mohawksoft.com> writes: > I need to do some OLAP stuff, and I asked previously if there were a way > to pass multiple parameters to an aggrigate function. i.e.: > I looked through the code and it is non-trivial to do, Offhand I don't know of any fundamental reason why it couldn't be done, but you're right that it'd take a fair amount of work. > If I do this: > select mycube(value1) as d1, dimention(value2) as d2, dimention(value3) > as d3 group by value1; > Can I safely assume the following: > (1) mycube() will be called first > (2) Assuming dimention() has no final func, that final func of mycube() > will be called last. That might be true in the present code, but it strikes me as an awfully risky set of assumptions. Also, it sounds like what you have in mind is to have some hidden state that all the aggregate functions will access; how then will you work if there are more than one set of these aggregates being used in a query? If the needed parameters are all the same datatype, maybe you could put them into an array and pass the array as a single argument to the aggregate. regards, tom lane
В списке pgsql-hackers по дате отправления: