Re: Planner creating ineffective plans on LEFT OUTER joins

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Planner creating ineffective plans on LEFT OUTER joins
Дата
Msg-id 3353.1214447769@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Planner creating ineffective plans on LEFT OUTER joins  (Andres Freund <andres@anarazel.de>)
Ответы Re: Planner creating ineffective plans on LEFT OUTER joins  ("Robert Haas" <robertmhaas@gmail.com>)
Re: Planner creating ineffective plans on LEFT OUTER joins  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> SELECT *
> FROM
>     ab LEFT OUTER JOIN (
>         bc JOIN cd
>         ON bc.c = cd.d
>     )
>     ON ab.b = bc.b
> WHERE
>     ab.a = 20000

> As ab.a = 20000 occurs only once in ab one would expect that it just does an 
> index scan on bc for ab.b = bc.b.

The only way it could do that would be by interchanging the order of the
left and inner joins, ie (ab left join bc) join cd; which would change
the results.

I believe it could interchange the joins if they were both LEFT or
both INNER.  Do you really need exactly these semantics?
        regards, tom lane


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

Предыдущее
От: Jan Urbański
Дата:
Сообщение: Re: Creating a VIEW with a POINT column
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Proposed Patch - LDAPS support for servers on port 636 w/o TLS