585 pts.
 SQL Server Plan Cache
There is a bucket in plan cache with 75 objects in it and it is the same sql statement. Other than using DBCC FREEPROCCACHE what will clear out the cache? Restarting SQL SERVER Service? I use the code below to look up how many plans are in a bucket.

SELECT   bucketid,   entries_in_bucket = COUNT(*) FROM sys.dm_exec_cached_plans GROUP BY bucketid ORDER BY 2 DESC



Software/Hardware used:
SQL SERVER 2005
ASKED: December 28, 2010  11:30 PM
UPDATED: December 29, 2010  1:59 PM

Answer Wiki:
You can flush the cache using DBCC, or restarting the SQL Server. If you do an sp_recompile on the object being queried then you will mark all the plans for that object as invalid. You can also change a server wide setting which will flush the cache.
Last Wiki Answer Submitted:  December 29, 2010  2:46 am  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _