|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, August 27, 2012 6:41 AM
Points: 2,
Visits: 224
|
|
Hi, I want to get the number of plans in cache procedure.
i launch Simultaneously two commands on my SQL Server 2005 and i have different results :
The 1st command :
SELECT COUNT(*) AS [Nb_Total_Plans] ,SUM(c.size_in_bytes)/(1024*1024) AS [Total_Cache_Size_Mo] FROM sys.dm_exec_cached_plans c CROSS APPLY sys.dm_exec_sql_text(plan_handle) s i have this results Nb_Total_Plans ................ Total_Cache_Size_Mo 2255 ................................ 180
The 2nd command :
SELECT COUNT(*) AS [Nb_Total_Plans] ,SUM(c.size_in_bytes)/(1024*1024) AS [Total_Cache_Size_Mo] FROM sys.dm_exec_cached_plans c i have this result
Nb_Total_Plans ................ Total_Cache_Size_Mo 2262 ................................ 175
What is the best pratice to have the Total plans in the procedure cache and the total memory size of the plans ?
Thank for help
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 7:02 PM
Points: 1,050,
Visits: 2,767
|
|
Not sure why you concern it that much.
I do not think you REALLY can Simultaneously run them. So of course the results were different.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: 2 days ago @ 12:03 PM
Points: 412,
Visits: 862
|
|
memory management is controled by sql server
when it requires it gets memory by deleting some plans from the cache
you can still release memory from plan cache by doing
dbcc freeproccache
but the case you described above is that both the queries are the same.
second one is best practise.
--SQLFRNDZ
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, August 27, 2012 6:41 AM
Points: 2,
Visits: 224
|
|
Ok,
Thank
|
|
|
|