Re: Eliminating unnecessary left joins

Поиск
Список
Период
Сортировка
От Andreas Pflug
Тема Re: Eliminating unnecessary left joins
Дата
Msg-id 4616FB3D.6000000@pse-consulting.de
обсуждение исходный текст
Ответ на Re: Eliminating unnecessary left joins  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Eliminating unnecessary left joins  ("Nicolas Barbier" <nicolas.barbier@gmail.com>)
Список pgsql-hackers
Tom Lane wrote:
> "Ottó Havasvölgyi" <havasvolgyi.otto@gmail.com> writes:
>   
>> When using views built with left joins, and then querying against these
>> views, there are a lot of join in the plan that are not necessary, because I
>> don't select/use any column of each table in the views every time. Tables
>> that are left joined and never referenced anywhere else in the query  should
>> be removed from the plan.
>>     
>
> That might cause you to get the wrong number of copies of some rows ---
> what if a row of the left table should join to multiple rows on the right?
>   
That would be trouble. But I've seen quite some cases where the right
can contain only zero or one row, because of PK constraints. In this
case, elimination would be safe.


Regards,
Andreas


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problems with the varlena patch in my module
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] [Fwd: Index Advisor]