BUG: Wrong Join Plan Selected That Causes Excessive Reads

Last reviewed: February 17, 1998
Article ID: Q170295
The information in this article applies to:
  • Microsoft SQL Server, version 6.5 Service Pack 2
BUG #: 16801 (6.5)

SYMPTOMS

The SQL Server optimizer sometimes does not choose the optimal join order. It may reformat the larger table involved in a join followed by excessive logical and physical reads on the worktable, which can introduce serious performance degradation.

CAUSE

The method used to calculate the cost of each possible join plan has been altered in SQL Server 6.5 Service Pack 2 to provide more accurate and thorough estimates. Incidentally, it introduced a very small window where it may calculate the cost incorrectly. In such cases, the best join plan, which was chosen by both the release build of SQL Server 6.5 and by Service Pack 1, is considered to be very costly.

WORKAROUND

The combination of SET FORCEPLAN ON, optimizer hint on index selection, and possibly trace flag 336 may force the optimizer to use the right join plan.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5 Service Pack 2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: slow sluggish high optimization
Keywords : kbbug6.50.sp2 SSrvGen kbusage
Version : WINNT:6.5 SP2
Platform : winnt
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 17, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.