|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 4:13 PM
Points: 2,766,
Visits: 1,442
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, February 03, 2012 2:43 AM
Points: 11,
Visits: 9
|
|
Excellent evidence-based article. More please.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, February 01, 2012 9:59 AM
Points: 28,
Visits: 59
|
|
Nice article .
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 4:11 AM
Points: 1,474,
Visits: 2,344
|
|
| Thanks David, useful article.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Yesterday @ 3:54 AM
Points: 383,
Visits: 203
|
|
Nice article, but I'm missing a hint to adhoc queries and their influence on the proc cache. You can save a lot of memory by using the optimize for ad hoc workloads Option. http://msdn.microsoft.com/en-us/library/cc645587.aspx
For more details see this blog entry from Kimberly Tripp: http://sqlskills.com/BLOGS/KIMBERLY/post/Procedure-cache-and-optimizing-for-adhoc-workloads.aspx
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 7:02 AM
Points: 1,286,
Visits: 1,411
|
|
| On your point regarding variable length parameters, I've seen Subsonic (ORM) do this behavior too. I figured it what was happening when I started digging into why my proc cache was 6GB. My devs changed their code to call procs (fixed-length parameters) and cut the proc cache down to 2.5GB. Happy day, my data cache hit ratio improved nicely with just a little bit of work.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Friday, May 31, 2013 6:50 AM
Points: 592,
Visits: 423
|
|
Great article David. Thank you.
I thought that there were limits imposed on the various memory components based on on the total amount of memory given to SQL Server.
For example: Proc Cache limits SQL Server 2005 SP2 75% of server memory from 0-4GB + 10% of server memory from 4Gb-64GB + 5% of server memory > 64GB So 14GB given to a SQL SERVER 2005 SP2 would yield a 4GB Proc Cache.
Is it correct in stating that the limits do not exist and proc cache for example can consume additional memory?
Thanks Mark
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 4:13 PM
Points: 2,766,
Visits: 1,442
|
|
Christoph Muthmann (1/31/2012) Nice article, but I'm missing a hint to adhoc queries and their influence on the proc cache. You can save a lot of memory by using the optimize for ad hoc workloads Option. http://msdn.microsoft.com/en-us/library/cc645587.aspx
Good catch, wish I'd known this 2 years ago! I've passed this one on to my colleagues. The worry now is that I'm going to hear "we don't have to fix this because there is a DB option".
LinkedIn Profile
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 4:13 PM
Points: 2,766,
Visits: 1,442
|
|
Mark, I haven't come across any predefined limits for proc cache but that doesn't mean to say they aren't there.
Time for further research methinks!
LinkedIn Profile
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 10:51 AM
Points: 1,562,
Visits: 1,932
|
|
David.Poole (1/31/2012)
Christoph Muthmann (1/31/2012) Nice article, but I'm missing a hint to adhoc queries and their influence on the proc cache. You can save a lot of memory by using the optimize for ad hoc workloads Option. http://msdn.microsoft.com/en-us/library/cc645587.aspx
Good catch, wish I'd known this 2 years ago! I've passed this one on to my colleagues. The worry now is that I'm going to hear "we don't have to fix this because there is a DB option". 
The only thing with that is you're still paying the cost to the query optimizer for each new compile. It's just taking less space in memory unless it's called again.
It's worth mentioning that you see the same capitalization behavior if you start using plan guides. It has to do with the fact that a hash of the query is created first and since there's potential for SQL to be capitalization sensitive it doesn't muck with capitalization before doing the hash.
|
|
|
|