Re: Slow views

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow views
Дата
Msg-id 1305.1090037080@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Slow views  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: Slow views  (David Newall <davidn-postgres@rebel.net.au>)
Список pgsql-bugs
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> You also did an optimization, removing the subquery which PostgreSQL
> isn't.

I suspect the real issue is that the implied join order is not the same.
The view-based query is really

    a LEFT JOIN (b LEFT JOIN c LEFT JOIN d LEFT JOIN e)

while the allegedly equivalent hand expansion is

    a LEFT JOIN b LEFT JOIN c LEFT JOIN d LEFT JOIN e

and since JOIN associates left-to-right, this is not the same thing at
all.  I'm not even convinced that it gives the same end result ...
INNER JOIN is associative but LEFT JOIN is not.

            regards, tom lane

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

Предыдущее
От: Nishad Prakash
Дата:
Сообщение: Cannot recreate DB scheme using pg_dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Replace function BUG