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.
| Author |
Topic |
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2002-09-19 : 23:03:59
|
| Hi Folks,I have a table which has the following structure:Create table individual_response(individual_id int,survey_id int,survey_question_id int,response int)There is a clustered index on individual_id and a nonclustered index on (survey_id,survey_question_id). I have a query which looks for records based on individual_id likeSELECT * FROM individual_response WHERE individual_id IN (2,8,20). Is having a clustered index on individual_id a good choice.2. The number individual_id's in the where clause can vary, at times here may be three id's and at times 12.3. When I used the survey_id and survey_question_id in the where clause, will the non-clustered index be used as a covering index.Will current indexing structure on the table work for these kind of queries.Any ideas/thoughts is appreciated.ByeRamdas NarayananSQL Server DBA |
|
|
lozitskiy
Starting Member
28 Posts |
Posted - 2002-09-20 : 09:27:55
|
| As for me it needs to create nonclustered index on (individual_id, survey_id, survey_question_id). This index is covering index.Also I recommend to add Id field with unique clustered index.-------------MCP MSSQL |
 |
|
|
ramdas
Posting Yak Master
181 Posts |
Posted - 2002-09-20 : 09:51:52
|
| Hi,Thanks for your reply.ByeRamdas NarayananSQL Server DBA |
 |
|
|
|
|
|