Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does table order in joins with WHERE clause matter?

Status
Not open for further replies.

jconner

Programmer
Oct 26, 2003
6
US
We have a situation where several tables are being joined together...with a few constraints on the query...and I was wondering whether or not the order in which the tables are joined mattered as far as the where clause is concerned. In other words, if I'm joining TABLE_A - TABLE B - TABLE C - and I have a WHERE clause with a condition for TABLE C, should TABLE C be listed first in the JOIN? If so, can you explain why? I'm a bit hazy on the nuts and bolts of joins in regards to performance.

Thanks!
Jconner
 
The order of tables in the JOIN clause or the order of different WHERE conditions does not matter at all. The query optimizer will examine the whole query and select the most efficient methods for executing it.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top