Re: OLAP, Aggregates, and order of operations
От | Tom Lane |
---|---|
Тема | Re: OLAP, Aggregates, and order of operations |
Дата | |
Msg-id | 8897.998594345@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | OLAP, Aggregates, and order of operations (mlw <markw@mohawksoft.com>) |
Список | pgsql-hackers |
mlw <markw@mohawksoft.com> writes: >> 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. > How would you do this without having to make multiple SQL calls? I was thinking something like select my_aggregate(my_array_constructor(foo, bar, baz)) from ... where my_array_constructor is a quick hack C routine to build a 3-element array from 3 input arguments (s/3/whatever you need/). Someday we ought to have SQL syntax to build an array value from a list of scalars, but in the meantime an auxiliary function is the only way to do it. The overhead of constructing and then interpreting the temporary array value is slightly annoying, but I don't think it'll be horribly expensive. See the existing aggregate-related routines in numeric.c if you need some help with the C coding. regards, tom lane
В списке pgsql-hackers по дате отправления: