<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www2.sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx</link><description>... I know I do. How many times have you seen the procedure cache bloat, for no good reason, because of badly designed applications? How many times have you been frustrated by the fact that SQL Server handles this in a relatively boneheaded way, and just</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2205</link><pubDate>Tue, 14 Aug 2007 13:28:25 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2205</guid><dc:creator>Denis Gobo</dc:creator><description>&lt;p&gt;You got my vote&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2208</link><pubDate>Tue, 14 Aug 2007 15:35:31 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2208</guid><dc:creator>Linchi Shea</dc:creator><description>&lt;p&gt;It's the app guys' fault. Design a better app instead! GDR.&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2209</link><pubDate>Tue, 14 Aug 2007 17:08:37 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2209</guid><dc:creator>Glenn Berry</dc:creator><description>&lt;p&gt;I agree this would be a very nice configuration option. Until then, DBCC FREEPROCCACHE is your friend...&lt;/p&gt;
&lt;p&gt;Seriously, I am forwarding this to a few people I know on the Product team to see if we can get this feature.&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2222</link><pubDate>Wed, 15 Aug 2007 17:41:47 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2222</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Thanks for the votes, everyone. &amp;nbsp;Hopefully this puts some pressure on them to act!&lt;/p&gt;
&lt;p&gt;Glenn, agreed about DBCC FREEPROCCACHE--I have also set up scheduled dumps in the past. &amp;nbsp;But people seem to get extremely paranoid about this stuff and in a recent consulting engagement where I suggested this as a possible fix--they had major proc cache bloat issues--the manager became extremely annoyed at the very idea that I would consider implementing such a &amp;quot;hack.&amp;quot; &amp;nbsp;Better for the engine to handle this, I think...&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2223</link><pubDate>Wed, 15 Aug 2007 18:47:54 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2223</guid><dc:creator>Whitney</dc:creator><description>&lt;p&gt;Adam,&lt;/p&gt;
&lt;p&gt;After your suggested &amp;quot;hack&amp;quot; caused annoyance did the client move forward with the change or just let the cache continue to run wild? &amp;nbsp;I get that it feels hackish but what other option do you really have (beside going to vote on connect ;) )?&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2224</link><pubDate>Wed, 15 Aug 2007 23:40:34 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2224</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;No--they refused to even try it, saying that it would &amp;quot;obviously&amp;quot; cause their CPUs to shoot to 100% and stay there... Of course, the compile/recompile counters already showed that virtually every query being submitted was already causing compiles to happen, so it wouldn't have made any difference... But sometimes paranoia wins over logic :)&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2225</link><pubDate>Thu, 16 Aug 2007 01:53:32 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2225</guid><dc:creator>Lara Rubbelke</dc:creator><description>&lt;p&gt;Thanks for submitting this one! &amp;nbsp;I had posted a blog on my old blog detailing issues I have experienced with this one (&lt;a rel="nofollow" target="_new" href="http://blogs.digineer.com/blogs/larar/archive/2007/07/15/memory-pressure-on-sql-server-2005-64-bit.aspx"&gt;http://blogs.digineer.com/blogs/larar/archive/2007/07/15/memory-pressure-on-sql-server-2005-64-bit.aspx&lt;/a&gt;). &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2227</link><pubDate>Thu, 16 Aug 2007 11:16:47 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2227</guid><dc:creator>Theo Ekelmans</dc:creator><description>&lt;p&gt;I've made a similar suggestion on MS connect (&lt;a rel="nofollow" target="_new" href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=289691"&gt;https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=289691&lt;/a&gt;) &lt;/p&gt;
&lt;p&gt;MS replied &amp;quot;we plan to release a new parameter of FREEPROCCACHE where you can identify a plan using its sql_handle or plan_handle and evict the plan from the proc cache&amp;quot; &lt;/p&gt;
&lt;p&gt;This way you can pick and choose what plans are unwanted and remove them from the procedure cache, i.e. the unparameterised danamic queries with a useage count of 1 &lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2228</link><pubDate>Thu, 16 Aug 2007 14:03:48 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2228</guid><dc:creator>WesleyB</dc:creator><description>&lt;p&gt;Yep... know the feeling.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://sqlug.be/blogs/wesleyb/archive/2007/01/24/486.aspx"&gt;http://sqlug.be/blogs/wesleyb/archive/2007/01/24/486.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lucky for us they already resized it in SP2 :-s&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#2229</link><pubDate>Thu, 16 Aug 2007 14:04:13 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2229</guid><dc:creator>WesleyB</dc:creator><description>&lt;p&gt;Oh yeah, but I do agree with Linchi :-D&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#3484</link><pubDate>Thu, 22 Nov 2007 12:34:05 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3484</guid><dc:creator>Dan</dc:creator><description>&lt;p&gt;Hi Adam&lt;/p&gt;
&lt;p&gt;I attended Kalen Delaney's talk to the UK user group in Reading last week. She went to great pains to point out how, in 2005 SP2, the plan cache clears trival ad-hoc plans once a threshold is reached. Reading between the lines it looks like cache bloat can still occur but by definition these plans would be non trivial, prepared plans - not the sort of stuff a poorly designed app is likely to churn out. This covers some of it: &lt;a rel="nofollow" target="_new" href="http://sqlblog.com/blogs/kalen_delaney/archive/2007/11/04/did-you-know-sp2-does-not-limit-the-amount-of-plan-cache-you-can-have.aspx"&gt;http://sqlblog.com/blogs/kalen_delaney/archive/2007/11/04/did-you-know-sp2-does-not-limit-the-amount-of-plan-cache-you-can-have.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What have I missed?&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#3670</link><pubDate>Tue, 04 Dec 2007 15:18:59 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3670</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Dan: You may not have missed anything at all. &amp;nbsp;I have not yet had a chance to test SP2 on the kinds of workloads that prompted me to write this post...&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#3773</link><pubDate>Fri, 07 Dec 2007 18:23:21 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3773</guid><dc:creator>Sangeetha</dc:creator><description>&lt;p&gt;Hi Adam, Have you had a chance to test out SQL 2005 SP2?&lt;/p&gt;
</description></item><item><title>A year in review, The 21 + 1 best blog posts on SQLBlog </title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#4217</link><pubDate>Thu, 27 Dec 2007 21:11:29 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:4217</guid><dc:creator>Denis Gobo</dc:creator><description>&lt;p&gt;A year in review, The 21 + 1 best blog posts on SQLBlog Best posts according to me, it might have been&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#5992</link><pubDate>Wed, 02 Apr 2008 14:35:44 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:5992</guid><dc:creator>Alan Danque</dc:creator><description>&lt;p&gt;You have my vote too! I installed SP2 and proccache still bloats out due to application exec of sp_execute. thanks&lt;/p&gt;
</description></item><item><title>SQL Server Procedure Cache: More Relief on the Way</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#6235</link><pubDate>Wed, 16 Apr 2008 00:27:24 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6235</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;If you've read many of my blog posts, you know that I consider lack of procedure cache control to be&lt;/p&gt;
</description></item><item><title>re: Want to Control the Procedure Cache?</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#6374</link><pubDate>Thu, 24 Apr 2008 00:44:57 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6374</guid><dc:creator>LC</dc:creator><description>&lt;p&gt;I'm one of the many DBAs suffering from this lack of proc cache control. &amp;nbsp;Our environment is mostly adhoc (parameterized, very few stored procs) by nature. &amp;nbsp;I've been running dbcc freesystemcache('all') every 30mins for ~2yrs now. &amp;nbsp;None of the 'fixes' from MS seem to fix the problem. &amp;nbsp;Adam's link above is only for SQL2008 so everyone on SQL2005 seems to be hosed. &amp;nbsp;With SQL2008 on the way I doubt MS will dedicate resources to SQL2005 and add any new features. &amp;nbsp;They're in mtc mode already with SQL2005 and all new features are going to SQL2008. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding Adam's link about caching the stub in SQL2008, I've been told by MS support recently that SQL will only cache a 300 byte 'stub' on the first run of the query (vs a minimum 32KB plan). &amp;nbsp;If the query is executed again it will upgrade the stub and cache the full plan. &amp;nbsp;I asked the support engineer twice and he verified the stub caching is only on the first run, not the subsequent runs so it doesn't sound like much help to me. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;LC&lt;/p&gt;
</description></item><item><title>Connect Digest : 2010-01-11</title><link>http://www2.sqlblog.com/blogs/adam_machanic/archive/2007/08/14/want-to-control-the-procedure-cache.aspx#20873</link><pubDate>Mon, 11 Jan 2010 22:04:02 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:20873</guid><dc:creator>Aaron Bertrand</dc:creator><description>&lt;p&gt;Control over procedure cache We are still waiting for more control over procedure cache. Adam Machanic&lt;/p&gt;
</description></item></channel></rss>