Re: hashjoin chosen over 1000x faster plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: hashjoin chosen over 1000x faster plan
Дата
Msg-id 20980.1192039650@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: hashjoin chosen over 1000x faster plan  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: hashjoin chosen over 1000x faster plan  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: hashjoin chosen over 1000x faster plan  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-performance
Simon Riggs <simon@2ndquadrant.com> writes:
> Basically the planner doesn't ever optimise for the possibility of the
> never-executed case because even a single row returned would destroy
> that assumption.

It's worse than that: the outer subplan *does* return some rows.
I suppose that all of them had NULLs in the join keys, which means
that (since 8.1 or so) nodeMergejoin discards them as unmatchable.
Had even one been non-NULL the expensive subplan would have been run.

This seems like too much of a corner case to justify adding a lot of
machinery for.

            regards, tom lane

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

Предыдущее
От: Josh Trutwin
Дата:
Сообщение: Re: SQL Monitoring
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: hashjoin chosen over 1000x faster plan