You are currently offline, waiting for your internet to reconnect

FIX: Optimizer Slow to Generate Query Plan for Complex Queries that have Many Joins and Semi-Joins

This article was previously published under Q274329
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 236107 (SHILOH_bugs)
When compiling complex queries that involve many views, which have more than 20 tables, joins, GROUP BY clauses, sub-queries and outer-joins, the optimizer takes a long time to produce a query plan. SQL Server still processes other queries and CPU use is high during this time.
The SQL Server query optimizer is a cost based optimizer and the optimizer is trying to build an optimal query plan. During optimization, the large number of joins, views, GROUP BY clauses, sub-queries and outer-joins are broken down into simpler operations, including semi-joins. Semi-joins interact with the join reordering logic and cause an increase in the combinations considered in higher levels of the operator tree. The server considers a large number of join permutations that are changed by the semi-joins below it, which results in reordering at the higher levels. In effect, the time to generate the optimal plan is much higher and it may appear that the query has stopped responding (hang).

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack


NOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 1.

The English version of this fix should have the following file attributes or later:
   File name       Platform   --------------------------   s80204I.exe     Intel X86				
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.
Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.
query hung opt lost loop infinite unresponsive sluggish perf performance

Article ID: 274329 - Last Review: 01/16/2015 20:46:25 - Revision: 3.1

Microsoft SQL Server 2000 Standard Edition

  • kbnosurvey kbarchive kbbug kbfix kbqfe kbsqlserv2000sp1fix KB274329