Re: Another planner/optimizer question...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Another planner/optimizer question...
Дата
Msg-id 21781.1004628155@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Another planner/optimizer question...  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: Another planner/optimizer question...  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> Is there any way to get PG to know that it only needs to do the
> aggregate once?

It'd probably be possible to look for duplicated aggrefs being assigned
to the same Agg plan node during planning.  However, I'm not entirely
convinced that it's worth the trouble --- the individual transition
function calls are not usually all that expensive.

But ... the example you are offering has nothing to do with aggregates.
Subplans are a different and much messier deal.  The best I could offer
you (short of a complete redesign of subqueries) would be to not pull up
views that have any subqueries, which would probably be a net loss.
        regards, tom lane


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

Предыдущее
От: "Tille, Andreas"
Дата:
Сообщение: Re: Serious performance problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Posgresql 7.2b1 crashes