Problem solve Get help with specific problems with your technologies, process and projects.

How to speed up a composite nonclustered index-based query

A query still responds slowly after implementing an index. Performance Tuning expert Jeremy Kadlec offers help troubleshooting the SQL Server problem.

Here's the situation: A composite nonclustered index is created with XYZ table with the columns ordered, seqno,del_date to improve the query below:

SELECT * FROM XYZ WHERE del_date BETWEEN @datefrom AND @dateto AND orderid=@orderid AND seqno=@seqno
ORDER BY orderid, seqno,del_date

Now, after implementing the index, the query still responds very slowly. What other steps are needed to resolve the problem?

Based on this information, you have a few different options that I think should be tested thoroughly in your development and test environment by reviewing the query plans. Here are a few high level thoughts:

  • Evaluate building a clustered index with the same column definition
  • Evaluate building a clustered index based on an identity and separate non-clustered indexes for each column
  • Evaluate building three separate non-clustered indexes for each of the columns

Dig Deeper on Microsoft SQL Server Performance Monitoring and Tuning

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.