Article ID: 274329 - View products that this article applies to.
This article was previously published under Q274329
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 the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/290211/EN-US/ )INF: How to Obtain the Latest SQL Server 2000 Service Pack
HotfixNOTE: 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:
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.
File name Platform -------------------------- s80204I.exe Intel X86
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.
Contact us for more help
Connect with Answer Desk for expert help.