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)
 performance on joins

Author  Topic 

jassie
Constraint Violating Yak Guru

332 Posts

Posted - 2011-07-28 : 00:18:05


I have the following performance question on joins in sql server 2008 r2.
Is there a performance problem when I join 5 tables using inner joins and 4 tables are joined using left outer joins?

Is there a performance problem with this type of join? If so, then should I join all the tables using left outer joins? I can not use all inner joins since all rows I want selected would not be picked.
(Note: This issue has occurred since my company is changing their production database. Basically there was one table that contained about eveything we needed. Now the new database is breaking up the one major table into nine different tables. The production application are the same, but they need to work with the new database.)
Thus basically in several stored procedures I need to join all nine of the tables. For a couple tables I need to do left outer joins, so at least data from from the 5 major tables will appear.

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2011-07-28 : 04:43:29
If you have your indexes right, there should not be a problem with the performance. Have a look at the execution plan and ensure there aren't any bottlenecks. If there are, it will most likely be indexes or the way the query is written.

http://www.techrepublic.com/blog/datacenter/see-sql-server-graphical-execution-plans-in-action/198

or

http://www.codeproject.com/KB/database/sql-tuning-tutorial-1.aspx

will help with understanding what you see on the screen..
Go to Top of Page
   

- Advertisement -