• SQLRNNR (2/5/2013)


    sqlfriends (2/5/2013)


    Thanks ALL.

    I read a tutorial and recommend this option should be enabled for all instances. Read and still a little confusing about when I should enable or disable it.

    I will dig more.

    Cite that article please.

    I wouldn't agree that it is something that must be done on all instances. Test it first for your environment and then make a decision whether or not to implement it in prod - but certainly not just a blanket yes for all instances.

    Glenn Berry talks about it as a standard config. In general may tend to agree with it although I suppose it could take a little while longer before the plan cache "warms up." I'll typically enable it by default unless I have a captive audience where I know all data access is done through stored procs or prepared statements:

    Some Suggested SQL Server 2008 R2 Instance Configuration Settings[/url]

    Optimize for ad-hoc workloads

    Optimize for ad-hoc workloads is a new instance level setting that was added in SQL Server 2008 which is designed to help control the amount of memory that is used by single-use, ad-hoc query plans in the procedure cache. It allows SQL Server to only store a small stub of an ad-hoc query plan in the procedure cache the first time the ad-hoc plan is executed, which reduces the memory required by the plan in the procedure cache.

    With SQL Server 2005, it was very common to see very large amounts of memory being used by single-use, ad-hoc query plans (often in the 6 to 8 GB range). Later builds of SQL Server have changes that reduced this problem somewhat, but it was still a big issue. Interestingly, one of the biggest offenders that generated ad-hoc query plans in SQL Server 2005 was SQL Server Agent! Another big offender was SharePoint.

    In my opinion, you should always enable this setting on SQL Server 2008 and above. I really cannot think of a good reason not to do this.

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