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


Does this sound like a good place to enable "Optimize for ad-hoc workloads?"


Does this sound like a good place to enable "Optimize for ad-hoc workloads?"

Author
Message
jasona.work
jasona.work
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4059 Visits: 11745
I recently ran the "Server Dashboard" report on a new server here. Imagine my reaction to seeing Adhoc Queries sucking up ~75% of the cumulative CPU Usage and 80-90% of the Logical IO!

So I started looking into the "Optimize for adhoc workloads." I read the articles by Kimberly Tripp, Technet stuff, and others, and it sounds like it may not be a bad idea to enable.

The server in question only has 4GB of RAM, and I suspect I could put in a request to get it doubled, but it's like pulling teeth from an angry hyena...

Running a couple queries agains dm_exec_cached_plans, out of 12975 cached plans, 10148 are adhoc, and 4910 of those are with usecounts of 1...

Now, I know enabling this won't immediately have an effect on the plan cache, and it will have something of a detrimental effect on the adhoc queries (no cached plan, takes longer to run.) I'd enable it in a test environment first, but the test server won't get hit as hard as the production...

So anyways, does it sound like it might provide some benefit to enable this option?

Thanks,
Jason
DBA From The Cold
DBA From The Cold
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2185 Visits: 1746
Hi,

Without knowing more about the server it is hard to make a call. How many and now big are the databases on it? What type of work load does it churn throughout one business cycle?

Andrew
Orlando Colamatteo
Orlando Colamatteo
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14943 Visits: 14396
jasona.work (6/28/2013)
I recently ran the "Server Dashboard" report on a new server here. Imagine my reaction to seeing Adhoc Queries sucking up ~75% of the cumulative CPU Usage and 80-90% of the Logical IO!

So I started looking into the "Optimize for adhoc workloads." I read the articles by Kimberly Tripp, Technet stuff, and others, and it sounds like it may not be a bad idea to enable.

The server in question only has 4GB of RAM, and I suspect I could put in a request to get it doubled, but it's like pulling teeth from an angry hyena...

Running a couple queries agains dm_exec_cached_plans, out of 12975 cached plans, 10148 are adhoc, and 4910 of those are with usecounts of 1...

Now, I know enabling this won't immediately have an effect on the plan cache, and it will have something of a detrimental effect on the adhoc queries (no cached plan, takes longer to run.) I'd enable it in a test environment first, but the test server won't get hit as hard as the production...

So anyways, does it sound like it might provide some benefit to enable this option?

Thanks,
Jason

Using a modified version of Kimberly's script helped me tame one SQL 2005 instance (no optimize for adhoc available) I had running on a 32-bit system with only 2.5 GBs of RAM set aside for the buffer pool: Plan cache, adhoc workloads and clearing the single-use plan cache bloat. If I had had the option I most definitely would have enabled optimize for adhoc.

Personally I do not see many downsides to enabling the setting, even on a system where stored procedures are predominantly used. The overhead of generating the stub-plan the first time around and deferring the full plan being cached until the second use has not proven to be detrimental to any of my systems. I enable the setting by default on all new instances.

If you are concerned or just simply want to see how it goes in a non-production environment you could run a Trace in production using the Replay template (server-side to a file though, not to a Profiler rowset) for as long as your system can stand it performance-wise. Then use that Trace file as a workload to run against a non-production database (after restarting the instance to slcear all caches) with the setting off, take your timings, and then run the workload again after enabling the setting and restarting the instance (to clear all caches again) to see if there is any negligible difference in performance or plan cache usage.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Go


Permissions

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

































































































































































SQLServerCentral


Search