Re: Eliminating unnecessary left joins

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Eliminating unnecessary left joins
Дата
Msg-id 1175935839.3623.560.camel@silverbirch.site
обсуждение исходный текст
Ответ на Re: Eliminating unnecessary left joins  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Eliminating unnecessary left joins  ("Ottó Havasvölgyi" <havasvolgyi.otto@gmail.com>)
Список pgsql-hackers
On Fri, 2007-04-06 at 19:38 -0400, 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?

In the case that PKs match between the tables, then exclusion is safe. 

This would enable vertical partitioning, so is a very desirable feature.

If this was possible, it would be a commonly used optimisation.

--  Simon Riggs              EnterpriseDB   http://www.enterprisedb.com




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

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: Bitmap index thoughts (another segfault)
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Fate of pgsnmpd