Re: Final Patch for GROUPING SETS

Поиск
Список
Период
Сортировка
От Atri Sharma
Тема Re: Final Patch for GROUPING SETS
Дата
Msg-id CAOeZVid-wruEF3NJgtag24uJnYCQ4TG_rMQCpGZnXfEqV86ODQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Final Patch for GROUPING SETS  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers


On Tuesday, December 23, 2014, Robert Haas <robertmhaas@gmail.com> wrote:
On Mon, Dec 22, 2014 at 11:19 AM, Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
>  Tom> The other reason that's a bad comparison is that I've not seen
>  Tom> many queries that use more than a couple of window frames,
>  Tom> whereas we have to expect that the number of grouping sets in
>  Tom> typical queries will be significantly more than "a couple".
>
> I would be interested in seeing more good examples of the size and
> type of grouping sets used in typical queries.

>From what I have seen, there is interest in being able to do things
like GROUP BY CUBE(a, b, c, d) and have that be efficient.  That will
require 16 different groupings, and we really want to minimize the
number of times we have to re-sort to get all of those done.  For
example, if we start by sorting on (a, b, c, d), we want to then make
a single pass over the data computing the aggregates with (a, b, c,
d), (a, b, c), (a, b), (a), and () as the grouping columns.



That is what ChainAggregate node does exactly. A set of orders that fit in a single ROLLUP list (like your example) are processed in a single go. 


--
Regards,
 
Atri
l'apprenant

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Final Patch for GROUPING SETS
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: TABLESAMPLE patch