Re: Why does adding SUM and GROUP BY destroy performance?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why does adding SUM and GROUP BY destroy performance?
Дата
Msg-id 18770.1063983015@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why does adding SUM and GROUP BY destroy performance?  (Ang Chin Han <angch@bytecraft.com.my>)
Список pgsql-general
Ang Chin Han <angch@bytecraft.com.my> writes:
> Christopher Browne wrote:
>> When you use SUM (or other aggregates), there are no short cuts to
>> walking through each and every tuple specified by the WHERE clause.

> Er... not in this case, if I read David's email correctly.

> His first query is walking through every tuple anyway.

No, it isn't, because he had a LIMIT.  I think the real point is that
computing the first fifty groups requires sucking in a lot more tuples
than just computing the first fifty rows.

            regards, tom lane

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

Предыдущее
От: Robert Treat
Дата:
Сообщение: Re: DDL diff utility?
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: State of Beta 2