Microsoft KB Archive/171879

From BetaArchive Wiki
Knowledge Base


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

Article ID: 171879

Article Last Modified on 10/3/2003



APPLIES TO

  • Microsoft SQL Server 6.5 Service Pack 1



This article was previously published under Q171879

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: kbbug kbfix kbprogramming kbsqlserv650bug KB171879