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)
 Index help

Author  Topic 

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-05-15 : 14:26:59
I have table InfoTech and columns hid int, name varchar (20),address (30), age int, ssn varchar (12). and it contains about 100,000 rows
I need to make query:
1. select * from InfoTech where name = @value1
2. select * from InfoTech where name = @value1 and address = @value2
2. Select * from InfoTech where name = @value1 and address = @value2 and age = @value3

I have already created clustered index on hid. Should I create covering (composite) index on (name, address ,age) or should I create separate indexes on each column (name, address ,age)? Please suggest.
Thanks
Sanjeev


tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-05-15 : 15:03:11
I'd suggest the composite index as all 3 queries can use it.

Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -