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 2000 Forums
 Transact-SQL (2000)
 All about JOINS

Author  Topic 

ramoneguru
Yak Posting Veteran

69 Posts

Posted - 2006-06-19 : 01:45:02
Is it a common practice to join on like 10 tables one right after the other? something along the lines of this:

SELECT <some stuff here>
FROM <some table> JOIN
<some table> ON (condition) JOIN
<some table> ON (condition) JOIN
<some table> ON (condition) JOIN
<some table> ON (condition) JOIN
<some table> ON (condition) JOIN
.
.
.
Now, I keep reading that it is more efficient to JOIN a subset of the original space before actually performing the JOIN operation (since its a Cartesion product followed by a SELECT) in order to be more efficient (is this correct)?? I just can't imagine a JOIN like that being terribly efficient. What do you use to improve something like that?
--Nick
I'd appreciate any advice since that post probably doesn't make to much sense to begin with

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2006-06-19 : 22:10:16
Don't worry about it. You do not "program the database" - you write a query and the query engine decides what to do. Just make sure you've defined the right question in the first place!
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-06-19 : 22:18:42
you can compare by showing the execution plan

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -