Article ID: 276067 - View products that this article applies to.
This article was previously published under Q276067
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 58397 (SQLBUG_70)
Under rare conditions, a symptom of having duplicate histogram steps for greater than or less than operations is that SQL Server selects a less than optimal query plan. The plan generally avoids the use of a valid index and uses a table or index scan to retrieve the data.
When SQL Server calculates the difference between the histogram steps a divide by zero error may occur. The divide by zero exception is handled by SQL Server but may result in incorrect cardinality estimation.
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
274799For more information, contact your primary support provider.
(https://support.microsoft.com/kb/274799/ )INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
This problem exists on all builds of SQL Server 7.0. However, due to other optimizer changes and enhancements the problem occurs more frequently with SQL Server 7.0 Service Pack 2 (SP2).