Microsoft KB Archive/316004

From BetaArchive Wiki
Knowledge Base


FIX: Floating Point Underflow Exception Causes Bad Cardinality Estimate

Article ID: 316004

Article Last Modified on 9/27/2005



APPLIES TO

  • Microsoft SQL Server 7.0 Standard Edition



This article was previously published under Q316004

BUG #: 102137 (SQLBUG_70)

SYMPTOMS

An incorrect cardinality estimate may result from a floating-point exception encountered if the following conditions are true:

  • The query contains an inner join that uses an equality predicate.
  • The density in each of the two respective histograms used in the estimate is very small.
  • An internal calculation that uses the two densities results in a floating-point underflow. Note that SQL Server catches and handles this particular floating-point underflow exception without any exception appearing in the SQL Server error log. The only way to determine if this condition is met is to run SQL Server under a debugger and monitor for a floating point exception raised in the EqualInner function.
  • In the absence of the underflow, there is other information upon which you can make a better estimate, such as the index being unique.


CAUSE

When the floating-point underflow occurs, SQL Server reverts to making a guess for the cardinality estimate, which is inaccurate.

RESOLUTION

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 the Microsoft 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:

   Date          File name
   ---------------------------

   7.00.1019     Sqlservr.exe
                

NOTE: Because of file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.


STATUS

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.

Keywords: kbbug kbfix kbsqlserv700presp4fix kbqfe kbhotfixserver KB316004