Re: WIP Join Removal
От | Heikki Linnakangas |
---|---|
Тема | Re: WIP Join Removal |
Дата | |
Msg-id | 48BD1852.1070904@enterprisedb.com обсуждение исходный текст |
Ответ на | Re: WIP Join Removal (Simon Riggs <simon@2ndQuadrant.com>) |
Ответы |
Re: WIP Join Removal
|
Список | pgsql-patches |
Simon Riggs wrote: > On Tue, 2008-09-02 at 13:20 +0300, Heikki Linnakangas wrote: >> Simon Riggs wrote: >>> It turns out that a join like this >>> >>> select a.col2 >>> from a left outer join b on a.col1 = b.col1 >>> where b.col2 = 1; >>> >>> can be cheaper if we don't remove the join, when there is an index on >>> a.col1 and b.col2, because the presence of b allows the values returned >>> from b to be used for an index scan on a. >> Umm, you *can't* remove that join. > > Yes, you can. The presence or absence of rows in b is not important to > the result of the query because of the "left outer join". > > I spent nearly a whole day going down that deadend also. Oh. How does the query look like after removing the join, then? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com
В списке pgsql-patches по дате отправления: