FIX: Wrong Index Chosen When Query References Values Beyond Statistics

Article translations Article translations
Article ID: 234883 - View products that this article applies to.
This article was previously published under Q234883
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 55366 (SQLBUG_70)
Expand all | Collapse all

SYMPTOMS

The optimizer may select the wrong plan for processing a query if the values in a search argument are not contained within the range of statistics for an expected index. This can cause significantly slower performance in queries.

This situation is usually encountered when nonclustered index growth is extending the index in a particular direction, in contrast to being randomly distributed throughout the values for the index. For a query that wants to use the nonclustered index in the outlying range, the clustered index may be improperly selected over the nonclustered index since the latter inserted values are not contained in the statistics for the nonclustered index (that is, the optimizer has no information that the outlying values exist).

WORKAROUND

Here are two workarounds:

  • Run UPDATE STATISTICS and execute sp_recompile on the affected table to alleviate the problem.
  • Consider making the extending index the clustered index.

STATUS

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:
254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

Properties

Article ID: 234883 - Last Review: October 21, 2013 - Revision: 2.1
APPLIES TO
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix KB234883

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com