FIX: Switching the Order of Tables in the FROM Clause Changes the Optimization

ID: Q171879


The information in this article applies to:
  • Microsoft SQL Server version 6.5 Service Pack 1 and later

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 : kbprg SSrvTran_SQL kbbug6.50 kbbug6.50.sp1 kbfix6.50.sp2
Version : 6.5 SP1
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: April 21, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.