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
 SQL Server Development (2000)
 Optimizing Sql Query

Author  Topic 

tomlev
Starting Member

1 Post

Posted - 2007-06-12 : 06:45:14
How do I optimize queries like this one ?

SELECT TABLE1.NAME,TABLE2.NAME,.....,TABLE100.NAME
FROM TABLE TABLE1,TABLE TABLE2,....,TABLE TABLE100
WHERE TABLE1.COLUMN4=TABLE2.COLUMN6 AND TABLE1.COLUMN2=TABLE4.COLUMN2 AND ..... AND TABLE100.COLUMN8=TABLE67.COLUMN5(hundreds of conditions)

(TABLE has about 10,000 touples, and 10 columns, except for the NAME column)

thanks, TOMLEV.

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-06-12 : 06:49:40
Joining more tables indicates that there is lack of denormalisation

--------------------------------------------------
S.Ahamed
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-12 : 09:31:41
Are you sure you want to join 100 tables or append the content into one?
Also refer
http://www.datamodel.org/NormalizationRules.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -