In Microsoft SQL Server 2005, you may experience a decrease in query performance after you perform certain database maintenance operations or regular transaction operations. For example, you may notice a sudden decrease in query performance after you restore a database backup.
Starting with SQL Server 2005 Service Pack 2, you will notice messages such as the following in the SQL Server error log when this issue occurs:
2006-10-15 06:03:29.330 spid59 SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2006-10-15 06:03:29.420 spid59 SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2006-10-15 06:03:29.420 spid59 SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
However, you can run the DBCC FREEPROCCACHE command or the DBCC FREESYSTEMCACHE command to flush the procedure cache. If the procedure cache is flushed by running one of these commands, you will notice messages that resemble the following in the SQL Server error log:
2006-12-14 11:37:03.57 spid53 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.
2006-12-14 11:37:03.57 spid53 SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to 'DBCC FREEPROCCACHE' or 'DBCC FREESYSTEMCACHE' operations.
Therefore, you can examine the SQL Server error log to determine whether the issue is caused by the problem that is described in this article.
Note This behavior does not occur in Microsoft SQL Server 2008.