Microsoft KB Archive/313313

= FIX: SP1 Regression: A SELECT COUNT(*) From a View That Contains a UNION ALL May Be Significantly Slower or Fail =

Article ID: 313313

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft SQL Server 2000 Service Pack 1
 * Microsoft SQL Server 2000 Service Pack 2

-



This article was previously published under Q313313



BUG #: 356082 (SHILOH_BUGS)



SYMPTOMS
A query like a &quot;SELECT COUNT(*)&quot; from a view that contains a UNION ALL statement from other views, tables or derived tables, may either be a hundred times slower than it was without any service packs installed, or it may not complete after it fills up the tempdb database. For more information, see the &quot;UNION&quot; and &quot;derived tables&quot; topics in SQL Server Books Online.

Note that this problem is data specific; therefore, the problem may not occur with all similar queries. Applying the fix that is described in this article only helps if you are experiencing the exact same scenario.



RESOLUTION
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:

290211 INF: How To Obtain the Latest SQL Server 2000 Service Pack

NOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.

The English version of this fix should have the following file attributes or later:   Date       Time   Version         Size        File name ---

11/20/01  5:29   2000.80.469.0    7,237 KB   Sqlservr.exe 11/20/01  5:29                   12,257 KB   Sqlservr.pdb NOTE: Because of file dependencies, the most recent hotfix or feature that contains the files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This problem was first corrected in Microsoft SQL Server 2000 Service Pack 3.



MORE INFORMATION
This hotfix also fixes similar problems with operators of GROUP BY and DISTINCT.

