Re: Which file does the SELECT?
| От | Tom Lane |
|---|---|
| Тема | Re: Which file does the SELECT? |
| Дата | |
| Msg-id | 12452.1286726358@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Which file does the SELECT? (Vaibhav Kaushal <vaibhavkaushal123@gmail.com>) |
| Ответы |
Re: Which file does the SELECT?
|
| Список | pgsql-hackers |
Vaibhav Kaushal <vaibhavkaushal123@gmail.com> writes:
> Can someone tell me what are 'Join Pairs with no Join clause' ? I am not
> able to figure that out!
Consider
select * from t1, t2, t3 where t1.a = t2.x and t1.b = t3.y;
In theory this query could be done by first joining t2 and t3, then
joining that to t1. But the planner won't investigate the possibility
because the t2/t3 join would have to be a cartesian product join:
there's no WHERE clause relating them.
On the other hand, if we have
select * from t1, t2, t3 where t1.a = t2.x and t1.a = t3.y;
then the planner is able to infer the additional join clause t2.x =
t3.y, so it will consider that join sequence.
regards, tom lane
В списке pgsql-hackers по дате отправления: