SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Plan Cache/Memory Performance

Plan Cache/Memory Performance

SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2118 Visits: 2931
Hi Guys

I am dealing with a system that seems to be under memory pressure. According to task manager, memory is always above 90% used.

I've used performance counters and noted the following:
Buffer Manager
PLE is consistently under 200
Plan Cache hit ratio never goes above 50%
Buffer cache hit ratio is above 90%
Page Reads is +-800
Plan Cache
Plan Cache hit ratio consistently below 50%

Also, I've noticed high amounts for Compilations and Re-compilations Per/Second

Also, a quick assessment showed me that there is +- 15000 Adhoc plans in my cache, +-13000 have only been used once

My initial thought was to enable "Optimize for Adhoc workloads", I can't do this because it's a 2005 instance

Another ideas that I have is to enable Forced Parameterization for the database(s). The problem is that this instance hosts 60 databases.

I'm trying to figure out how I can narrow down to the database for which the majority of these single-use plans exist.

I have used the below script to return all single-use plans, from a quick glance through the results, I was able to deduce that there are single use non-parameterized plan shells (From auto-parameterization).

Any ideas how I can narrow my search to which database I can start looking at for possible Forced Parameterization and also how I can retrieve the results from my script, excluding the non-parameterized plan shells.?

SELECT  [text] ,
cacheobjtype ,
objtype ,
cp.size_in_bytes ,
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_sql_text(plan_handle) st
WHERE text NOT LIKE '%sys.dm_exec_cached_plans%'
AND cacheobjtype != 'Parse Tree'
and usecounts = 1
and cacheobjtype = 'Compiled Plan'
and objtype = 'Adhoc'



You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum