Article ID: 246474 - View products that this article applies to.
This article was previously published under Q246474
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 56775 (SQLBUG_70)
When executing a query with a WHERE clause that references a date column that has a clustered index and any other column having a non-clustered index, SQL Server may choose an inefficient clustered index resulting in excessive response time to the user.
The optimizer chooses an inefficient clustered index. Forcing a non-clustered index gives much better performance in a simple SELECT statement with 2 search arguments (SARGs), one of which is a DATE range.
If a table has a clustered index on date column (column1) and non-clustered index on any other column (column2) and you perform a simple SELECT on the table with WHERE condition BETWEEN date range (column1) AND column2 = 'value' like this:
The optimizer choses the clustered index on column1 even though use of a non-clustered index on column2 gives better performance. That is, less CPU time and logical reads.
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561For more information, contact your primary support provider.
(http://support.microsoft.com/kb/254561/ )INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0