Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 Article: What Query Plans are in SQL Server's Memory?

Author  Topic 

Ask SQLTeam Question

0 Posts

Posted - 2007-07-24 : 08:50:14

SQL Server memory is primarily used to store data (buffer) and query plans
(procedure cache). In this article I'll show how much memory is allocated to the procedure
cache (RAM). I'll explain how to determine what plans are in the cache and how
often they're used.

Read What Query Plans are in SQL Server's Memory?

Aged Yak Warrior

841 Posts

Posted - 2007-07-25 : 07:04:23
This is brilliant I think. Thanks very much. It tells me more about what's going on; things that could be harder to spot by simply setting up a trace.
Go to Top of Page

Yak Posting Veteran

83 Posts

Posted - 2007-07-27 : 09:58:15
Yes, good stuff, Graz. 2005 gives us some great tools in this regard. We are using 2005 RTM and have 55GB of RAM set aside for SQL Server. Of that, 23 GB is allocated to plan cache! Wow. This is one of the main reasons we are hesitant about moving to sp2 - the algorithm for allocating memory to the plan cache changes drastically. Our calculations show that with sp2 our plan cache will be capped at 8GB. That's a 65% drop, which means plans will be swapped in/out at a much higher rate than right now. Our average CPU utilization is already pretty high, and since recompiling is CPU-intensive, you can see why we are nervous.

Anyway, I'll be taking these DMVs and going into much deeper detail on their usage, as well as some other related DMVs, at the PASS conference this year. In fact, we've put a graphical front-end on these DMVs, and I'll be showing our production system live during the session. DBA-309 if you're interested.

Go to Top of Page

Aged Yak Warrior

841 Posts

Posted - 2007-08-10 : 05:16:59
Also, this and more functionality is included in this tool:
Go to Top of Page

Starting Member

1 Post

Posted - 2007-11-30 : 00:36:16
Here are a couple of good links to why the plan cache size was changed. Having a very large plan cache rarely results in improved performance.
Go to Top of Page

- Advertisement -