If I join a few tables together, some of which have few records, some with many records, does the order of the join statements affect performance? If so, what is a good strategy for determining join order?
In theory, the execution plan query optimizer will find the optimum execution path regardless of the order you've specified them. And in practice, whenever I've played around with various wording when working with large tables and joins, I've not seen any difference.
But there may be some odd situation where the order does make a difference, but I've not tripped over it.
One thing to keep in mind, though, when deciding where to put your join clauses (from BOL):
the ability to specify Transact-SQL outer joins in the WHERE clause is not recommended, is no longer documented, and will be dropped in a future release. -----------------
Robert Bradley
use coupon code "TEKTIPS" for 15% off at:
Thanks, FoxDev. I tried a few different combinations and it made no difference. I did learn some new thngs about studying the execution plan in Query Analyzer, though.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.