FIX: Switching Order of Tables in FROM Clause Changes Optimizer

Last reviewed: August 5, 1997
Article ID: Q171879
The information in this article applies to:
  • Microsoft SQL Server, versions 6.5 and 6.5 Service Pack 1
BUG #: 15522 (WINDOWS: 6.5)

SYMPTOMS

Switching the order of tables in the FROM clause for some join queries may result in a non-optimal execution of the query plan. In one scenario for a two-table join, significant difference in the execution times was noted between two identical queries that had the same WHERE clause, but had the order of tables in the FROM clause switched.

This behavior was noted on the release and Service Pack 1 versions of SQL Server 6.5.

WORKAROUND

For the Optimizer to use the optimal join order, compare the execution times and plans for the query and place the tables that result in better execution times in the FROM clause.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.


Additional query words: sp sp2 sp1 golden
Keywords : kbbug6.50 kbbug6.50.sp1 kbfix6.50.sp2 SSrvTran_SQL kbprg
Version : 6.5 SP1
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbfix


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: August 5, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.