How to determine the cache plan size in SQL server?

How to determine the cache plan size in SQL server?

–SQL 2012+ Plan Cache Size

— How big is the plan cache SQL 2012

select name, sum(pages_kb) /1024.0 MBUsed

from sys.dm_os_memory_clerks

where name = ‘SQL PLans’

group by name;

–Pre-SQL 2012 Plan Cache Size

— How big is the plan cache pre SQL 2012

select name, SUM(single_pages_kb + multi_pages_kb)/1024.0 MBUsed

from sys.dm_os_memory_clerks

where name = ‘SQL PLans’

group by name;

 

Leave a Reply

Your email address will not be published. Required fields are marked *