Q

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
This was first published in December 2005

Dig deeper on Microsoft SQL Server Performance Monitoring and Tuning

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close