Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Performance on JOIN

Author  Topic 

sql_server_dba
Posting Yak Master

167 Posts

Posted - 2012-04-19 : 13:00:42
If we have 3 tables A, B and C with A having 1 million, B having 2 million and C having only 100000.

What would be the difference between joining
SELECT *
FROM A
INNER JOIN B
ON A.x = B.X
INNER JOIN C
ON A.X = C.X

and

SELECT *
FROM A
INNER JOIN C
ON A.x = C.x
INNER JOI B
ON A.x = B.x

Will there be any performance difference?????

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-04-19 : 14:32:30
There would not be any performance difference.

What you could do though, is to make sure that:
a) there are appropriate indexes on the join columns, and limit the rows retrieved via where clauses if applicable
b) you list only the columns you need in the select list instead of using SELECT *
Go to Top of Page
   

- Advertisement -