Microsoft KB Archive/294874

= FIX: Combination of Multiple EXIST, OR, and Subquery Clauses May Give a Sub-Optimal Plan =

Article ID: 294874

Article Last Modified on 11/6/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q294874



BUG #: 352700 (SHILOH_BUGS)



SYMPTOMS
You may see performance degradation when both of the following conditions are met:
 * OR is used on multiple EXISTS subqueries in the WHERE clause.


 * The subqueries also have EXISTS.



CAUSE
Under a very narrow set of circumstances that involve multiple OR, EXIST, and subquery clauses, the estimated I/O for the various steps may be incorrectly combined, which results in a sub-optimal plan choice.



RESOLUTION
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack



WORKAROUND
Rewrite the query to use joins rather than subqueries.



STATUS
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

Additional query words: plan optimize slow

Keywords: kbbug kbfix kbsqlserv2000sp1fix KB294874

-

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

© Microsoft Corporation. All rights reserved.