You are currently offline, waiting for your internet to reconnect

FIX: Poor Cardinality Estimate for Tables with Multiple Qualifying Histogram Values

This article was previously published under Q298643
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 101661 (SQLBUG_70)
The SQL Server optimizer may fail to accurately estimate how many rows will qualify for an expression of the form [column] = [value] if the following conditions are true:
  • [column] is the leading column in an existing index or statistics collection.
  • The literal [value] in the expression is stored in the first two steps (and only in the first two steps) of the histogram.
  • The other rows in the table that do not equal this value are highly unique.
The error in estimating the number of rows that qualify may cause the optimizer to choose a suboptimal query plan.
If the first two steps (and only the first two) of the histogram have the same value, the optimizer could fail to detect that this is a frequent value.
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack
NOTE: The following hotfix was created prior to Microsoft SQL Server 7.0 Service Pack 4.

The English version of this fix should have the following file attributes or later:
   Version      File name   --------------------------   7.00.994     Sqlservr.exe    7.00.994     Sqlsort.dll				
NOTE: Because of file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 7.0 Service Pack 4.
You can use DBCC SHOW_STATISTICS to view the historgam for the index being used.

Article ID: 298643 - Last Review: 10/23/2013 19:37:40 - Revision: 1.1

Microsoft SQL Server 7.0 Standard Edition

  • kbnosurvey kbarchive kbbug kbfix KB298643