Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
FIX: SP1 Regression: A SELECT COUNT(*) From a View That Contains a UNION ALL May Be Significantly Slower or Fail
Article ID: 313313 - View products that this article applies to.
This article was previously published under Q313313
BUG #: 356082 (SHILOH_BUGS)
A query like a "SELECT COUNT(*)" 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 "UNION" and "derived tables" 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.
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:
290211NOTE: The following hotfix was created before the release of Microsoft SQL Server 2000 Service Pack 3.
(http://support.microsoft.com/kb/290211/EN-US/ )INF: How To Obtain the Latest SQL Server 2000 Service Pack
The English version of this fix should have the following file attributes or later:
NOTE: Because of file dependencies, the most recent hotfix or feature that contains the files may also contain additional files.
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
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.
This hotfix also fixes similar problems with operators of GROUP BY and DISTINCT.