Microsoft KB Archive/266617

= BUG: Combination of Top, an Inequality, and a Join Result in Incorrect Choice of a Table Spool Plan =

Article ID: 266617

Article Last Modified on 9/4/2002

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q266617



BUG #: 58107 (SQLBUG_70)



SYMPTOMS
When a query has the TOP keyword and an inequality (such as <, <=, >, >=, LIKE, or BETWEEN) combined with a join, the optimizer may incorrectly choose a TABLE SPOOL plan which results in decreased performance.



CAUSE
SQL Server may incorrectly estimate the cost for certain plans that involve the TOP command, leading to the choice of a less than optimal plan.



WORKAROUND
To work around this problem:
 * Don't use the TOP keyword in combination with a join and an inequality.
 * Use a join or index hint.
 * Use Microsoft SQL Server 2000, which has changes in the way that SQL Server handles buffer calculations.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0.

Additional query words: slow fast degraded less greater like optimize bad poor

Keywords: kbbug kbpending kbworkflowdesigner KB266617

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.