Select the product you need help with
FIX: Application performance issue when a query references temporary tables that are created in a session in SQL Server 2008 and in SQL Server 2008 R2Article ID: 2526959 - View products that this article applies to. Microsoft distributes Microsoft SQL Server 2008 R2 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. SYMPTOMSConsider the following scenario:
Note For more information about how to identify this issue, see the "More information" section. CAUSEThis issue occurs because the same query plans are inserted into cache in the same hash bucket for each user when the query text is the same. When a large number of plans are hashed to the same bucket (also known as a hash chain), the time to look up a plan in the cache increases significantly, and the performance issues may occur. Additionally, worker threads may encounter severe spinlock contention, and other threads are affected when these worker threads do not perform the correct scheduler yields. RESOLUTIONNote Only the update for SQL Server 2008 R2 is currently available. For SQL Server 2008, see the "Workaround" section to work around this issue. Cumulative update informationSQL Server 2008 R2 Service Pack 1The fix for this issue was first released in Cumulative Update 1 for SQL Server 2008 R2 Service Pack 1. For more information about how to obtain this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:2544793 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2544793/
)
Cumulative Update package 1 for SQL Server 2008 R2 Service Pack 12567616
(http://support.microsoft.com/kb/2567616/
)
The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 1 was released SQL Server 2008 R2The fix for this issue was first released in Cumulative Update 7. For more information about how to obtain this cumulative update package for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:2507770 Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/2507770/
)
Cumulative Update package 7 for SQL Server 2008 R2 981356
(http://support.microsoft.com/kb/981356/
)
The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 was releasedSTATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. WORKAROUNDTo work around this issue in SQL Server 2008 and in SQL Server 2008 R2, move any references of temporary tables to inside stored procedures. MORE INFORMATIONFor more information about how to create and modify table basics, visit the following MSDN website: Spinlock contention can be identified from the sys.dm_os_spinlock_stats dynamic management view (DMV) that has a high contention rate on the SOS_CACHESTORE spinlock. To identify this issue, run a query that resembles the following:
PropertiesArticle ID: 2526959 - Last Review: July 18, 2011 - Revision: 4.0 APPLIES TO
| Article Translations
|


Back to the top








