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
 Transact-SQL (2008)
 Inner Join Performance

Author  Topic 

evogli
Starting Member

7 Posts

Posted - 2012-02-22 : 14:55:58
Hello,

I have two tables,

CLIENTS (ID INT, FIRSTNAME VARCHAR(50)...)
ORDERS (ID INT, ORDERID VARCHAR(20), CLIENTID INT)

The CLIENT table has about 1000 rows and the ORDERS table has about 50,000 rows.

I can do a INNER JOIN like this:

SELECT C.*, O.* FROM CLIENTS C INNER JOIN ORDERS O ON C.ID = O.CLIENTID

OR LIKE THIS:

SELECT O.*, C.* FROM ORDERS O INNER JOIN CLIENTS C ON O.CLIENTID = C.ID

Which way does SQL SERVER prefer to give the best performance? Does it make a difference?

Thank you.

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-22 : 15:04:22
it makes no difference..however, what would make a difference is only Selecting the columns you want

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -