Re: Any better plan for this query?..

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Any better plan for this query?..
Дата
Msg-id 19434.1242773385@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Any better plan for this query?..  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Any better plan for this query?..
Список pgsql-performance
Simon Riggs <simon@2ndQuadrant.com> writes:
> On Tue, 2009-05-19 at 08:58 -0400, Tom Lane wrote:
>> Nonsense.  The planner might think some other plan is cheaper, but
>> it definitely knows how to do this, and has since at least 8.1.

> Please look at Dimitri's plan. If it can remove the pointless sort, why
> does it not do so?

I haven't followed the whole thread, but the plan in the original post
is for a hash join.  The planner does not trust a hash join to preserve
the order of its left input, because of possible batching.  See the
discussion a couple of months ago where we considered allowing the
planner to disable batching so it *could* assume order preservation, and
decided the risk of hashtable bloat was too great.

            regards, tom lane

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Any better plan for this query?..
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Any better plan for this query?..