Re: Functional dependency in GROUP BY through JOINs

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Functional dependency in GROUP BY through JOINs
Дата
Msg-id 20121206180009.142840@gmx.com
обсуждение исходный текст
Ответ на Functional dependency in GROUP BY through JOINs  ("David Rowley" <dgrowleyml@gmail.com>)
Список pgsql-hackers
Tom Lane wrote:

> In the case being presented here, it's not apparent to me that
> there's any advantage to be had at all.

The OP reported a different plan which was twice as fast, although
showing EXPLAIN ANALYZE results for both would be nice confirmation
of that.

> You still need to aggregate over the rows joining to each
> uniquely-keyed row.

Yes.

> So how exactly are you going to "push down the GROUP BY", and
> where does the savings come from?

There are 1000000 million rows in bigsalestable that fall into 450
groups. The question is whether you look up related data in the
products table once per row or once per group. Apparently those
extra 999550 lookups take enough time to matter.

-Kevin



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Functional dependency in GROUP BY through JOINs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Setting visibility map in VACUUM's second phase