Re: Eliminating unnecessary left joins

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas ADI SD
Тема Re: Eliminating unnecessary left joins
Дата
Msg-id E1539E0ED7043848906A8FF995BDA57901E7BD3F@m0143.s-mxs.net
обсуждение исходный текст
Ответ на Re: Eliminating unnecessary left joins  ("Ottó Havasvölgyi" <havasvolgyi.otto@gmail.com>)
Список pgsql-hackers
> Maybe odd, but simpler to optimize this way.
>
> Your idea would be also a very good optimization, there was
> already a discussion about that here:
> http://archives.postgresql.org/pgsql-performance/2006-01/msg00
> 151.php, but that time Tom refused it because it was too
> expensive and rare. Maybe now he has a different opinion.
> However, left join optimization is lot simpler and cheaper,
> and can be useful not only for O/R mappers, but for efficient
> vertical partitioning as Simon mentioned.

For the views use case there is a simple solution without the expensive optimization:
If you have a PK FK relationship simply rewrite the view to use a left join instead
of a join. Since there is always one row on the outer (PK) side it makes no difference to the result set.
And then the left join optimization can be used.

Andreas


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

Предыдущее
От: "Ottó Havasvölgyi"
Дата:
Сообщение: Re: Eliminating unnecessary left joins
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Vista/IPv6