Please start any new threads on our new site at https://forums.sqlteam.com. 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 

AskSQLTeam
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?

coolerbob
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

ThreePea
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.

3P
Go to Top of Page

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2007-08-10 : 05:16:59
Also, this and more functionality is included in this tool:
http://www.microsoft.com/downloads/details.aspx?familyid=1d3a4a0d-7e0c-4730-8204-e419218c1efc&displaylang=en
Go to Top of Page

platinumriver
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.

http://blogs.technet.com/vipulshah/archive/2007/09/24/understanding-query-plan-cache-in-sql-2005-sp2-why-it-s-changed-from-sql-2005-rtm-sp1.aspx

http://blogs.msdn.com/sqlprogrammability/archive/2007/01/22/3-0-changes-in-caching-behavior-between-sql-server-2000-sql-server-2005-rtm-and-sql-server-2005-sp2.aspx
Go to Top of Page
   

- Advertisement -