MySQL Forums
Forum List  »  MyISAM

Does Join order make a difference?
Posted by: scott cornwell
Date: March 17, 2006 01:25PM

I have always wondered this so maybe someone knows the answer.

In the following example, would the order of the joins make a difference on large tables?

for example would
SELECT T1.*, T2.*, T3.* FROM T1
LEFT JOIN T2 ON T1.id = T2.id
LEFT JOIN T3 ON T1.id = T3.id
WHERE ......

be any different than the following (T3 is joined on first)
SELECT T1.*, T2.*, T3.* FROM T1
LEFT JOIN T3 ON T1.id = T3.id
LEFT JOIN T2 ON T1.id = T2.id
WHERE ......

the second question, would the following make a difference
(where the last join is changed from ON T2.id = T1.id to ON T2.id = T3.id)

SELECT T1.*, T2.*, T3.* FROM T1
LEFT JOIN T2 ON T1.id = T2.id
LEFT JOIN T3 ON T2.id = T3.id
WHERE .....

Thanks in advance

Options: ReplyQuote


Subject
Views
Written By
Posted
Does Join order make a difference?
2602
March 17, 2006 01:25PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.