More TokenAndPermUserStore
I was interested in Jasper’s post
http://sqlblogcasts.com/blogs/sqldbatips/archive/2007/07/18/troubleshooting-performance-issues-with-tokenandpermuserstore-in-sql2005.aspx?CommentPosted=true#commentmessage
The following may also be of interest to readers.
http://support.microsoft.com/default.aspx/kb/927396
http://blogs.msdn.com/sqlprogrammability/archive/2007/01/23/4-0-useful-queries-on-dmv-s-to-understand-plan-cache-behavior.aspx
I’m currently working on optimizing a SQL 2005 application, it would appear the main issues are probably within the app rather than sql server, but that’s another story!
As part of the optimization we’ve deployed a number of plan guides and as part of that process I’ve been clearing the cache :-
DBCC FREESYSTEMCACHE ('TokenAndPermUserStore')
go
However of late we’re waiting on some changes before continuing – here’s the results I got from my server ( names changed to protect the innocent ) with this query:
Be careful how you run this on a production server.
( my cache size at the time was 450mb btw )
I’d probably be inclined to track all the counts over time as on my system this is extremely volatile, my proc cache varies between 800mb and 2.1 gb
|
select name, count(*) from sys.dm_os_memory_cache_entries
group by name
order by count(*) desc ;
|
|
name |
count |
|
Bound Trees |
108 |
|
Broker dormant rowsets |
17 |
|
Database4 |
77 |
|
Extended Stored Procedures |
18 |
|
Database5 |
23 |
|
master |
139 |
|
model |
26 |
|
msdb |
200 |
|
mssqlsystemresource |
112 |
|
Object Plans |
147 |
|
ObjPerm - master |
16 |
|
ObjPerm - mssqlsystemresource |
1 |
|
ObjPerm - tempdb |
1 |
|
ObjPerm – Database1 |
49 |
|
ObjPerm – Database2 |
1843 |
|
SchemaMgr Store |
123 |
|
Service broker mapping table |
1 |
|
Service Broker Null Remote Service Binding Cache |
1 |
|
Service broker routing cache |
3 |
|
SOS_StackFramesStore |
1 |
|
SQL Plans |
7871 |
|
sxcCacheStore |
52 |
|
SystemRowsetStore |
354 |
|
tempdb |
63 |
|
Temporary Tables & Table Variables |
12 |
|
TokenAndPermUserStore |
837993 |
|
Database1 |
1392 |
|
Database3 |
35 |
|
Database2 |
4208 |
You can also use this query, provided by Microsoft “EMEA Customer Service & Support - SMS&P” , thank you.
|
select * from sys.dm_os_memory_cache_entries
where cast(entry_data as xml).value('(//@class)[1]', 'bigint') = 65535; |
As a footnote I’m using 32 bit sql on 64bit o/s with rollup 3161 applied.