Re: Improving planning of outer joins

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Improving planning of outer joins
Дата
Msg-id 20051216201243.GA27602@surnet.cl
обсуждение исходный текст
Ответ на Improving planning of outer joins  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Improving planning of outer joins  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> I've spent some time looking into how we can improve our planning of outer
> joins.  The current planner code slavishly follows the syntactic join
> order, which can lead to quite bad plans.  The reason it does this is that
> in some cases altering the join order of outer joins can change the
> results.  However, there are many cases where the results would not be
> changed, and we really need to start taking advantage of those cases.

I wonder if the code is already able to transform right joins to left
joins, like(A rightjoin B on (Pab)) = (B leftjoin A on (Pab))

I haven't looked at the code but I vaguely remember it is possible with
some strings attached, like not being able to use not-mergejoinable
conditions or something.  I imagine it shows up as a leftjoin node with
some flag set.

How does this affect this optimization?  Does this hold:

(A rightjoin B on (Pab)) innerjoin C on (Pbc)= (B leftjoin A on (Pab)) innerjoin C on (Pbc)= (B innerjoin C on (Pbc))
leftjoinA on (Pab)
 

?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Web archive issue?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Improving planning of outer joins