FIX: Query Plan Inconsistent If Search Value > Last Step

ID: Q134822


The information in this article applies to:

BUG# NT: 10264 (6.00)

SYMPTOMS

The Microsoft SQL Server version 6.0 query optimizer may sometimes choose to use an index and sometimes choose to do a table scan for the same query on the same data with the same distribution statistics.


CAUSE

The query optimizer incorrectly calculates the cost of using an index when the query WHERE clause contains a search value that is greater than the largest distribution step for a given index, but less than the largest value in the table for the indexed column.

Even if the above conditions are met, the problem is still unlikely to occur with most queries. If you suspect this problem is occurring on a slow-running query, you should take other troubleshooting steps first, including running the UPDATE STATISTICS statement, examining the query's showplan output, and examining the table/index design as described in Knowledge Base article Q110352 - "INF: Optimizing SQL Server Performance."


WORKAROUND

Use optimizer hints to force a given query plan.


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.0. This problem was corrected in Service Pack 1 for SQL Server version 6.0. For more information, contact your primary support provider.

Additional query words: sql6 optimization performance


Keywords          : kbenv SSrvProg SSrvTran_SQL kbbug6.00 kbfix6.00.sp1 
Version           : 6.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: April 20, 1999