Re: improving a badly optimized query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: improving a badly optimized query
Дата
Msg-id 24969.1037982853@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: improving a badly optimized query  (Brandon Craig Rhodes <brandon@oit.gatech.edu>)
Список pgsql-general
Brandon Craig Rhodes <brandon@oit.gatech.edu> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> It seems like a useful optimization, but I have an uncomfortable
>> feeling that there's something wrong with it.  Can you point to a
>> rigorous proof that this is okay in complicated contexts such as
>> nested outer joins?

> We can optimize the above query simply by observing that the result of
> a LEFT JOIN includes both the rows that would have been produced by a
> simple JOIN, and those rows of the left table that did not match any
> from the right. [snip]

You didn't answer my question: when there are *nested* outer joins, how
does this transformation apply?  Can a clause from WHERE or an
upper-level JOIN/ON clause be pushed down past one outer join and into
another?

            regards, tom lane

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: Lack of use of indexes
Следующее
От: Don Isgitt
Дата:
Сообщение: Re: Lack of use of indexes