Article ID: 165510 - Last Review: March 14, 2006 - Revision: 4.0

FIX: Numeric and Decimal Datatypes Do Not Always Use an Index

This article was previously published under Q165510
BUG #: 16301 (SQLBUG_65)
Expand all | Collapse all

SYMPTOMS

A query can be very slow if the qualifying column used in the where clause is either a numeric or decimal data type. The query can be slow even if the columns have indexes. A show plan of the query shows that the optimizer chooses to do a table scan rather than use the index.

This problem only occurs in Microsoft SQL Server version 6.5 Service Pack 2. Earlier versions of SQL Server do not have this problem.

WORKAROUND

Change your query to use another column as the qualifier, or use a composite index with the first part of the index key not being a decimal or numeric data type. Another workaround is to change the qualifying column used in the where clause to truly be numeric or decimal. For example, instead of using 9, use 9.0, or do a convert to numeric or decimal.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:
197177  (http://support.microsoft.com/kb/197177/ ) INF: How to Obtain SQL Server 6.5 Service Pack 5a
For more information, contact your primary support provider.

APPLIES TO
  • Microsoft SQL Server 6.5 Standard Edition
Keywords: 
kbbug kbfix kbusage KB165510
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations