<?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>Kalen Delaney : Inside SQL Server</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx</link><description>Tags: Inside SQL Server</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Geek City: SQL Server 2008 Internals is Orderable!</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2008/10/23/SQL-Server-2008-internals-is-orderable.aspx</link><pubDate>Thu, 23 Oct 2008 22:08:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:9629</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>3</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/9629.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=9629</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Less than a week ago, &lt;A href="http://sqlblog.com/blogs/kalen_delaney/archive/2008/10/17/there-is-a-light-at-the-end.aspx" target=_blank&gt;I told you about&lt;/A&gt; making some major progress on my new book, and that it would "soon" be pre-orderable.&lt;/P&gt;
&lt;P&gt;It turns out it already was orderable, as my helpful readers let me know.&amp;nbsp; So here is the link to Amazon, for all of you who want to get the book as soon as it hits the streets!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.amazon.com/gp/product/0735626243?ie=UTF8&amp;amp;tag=insqse-20&amp;amp;link_code=as3&amp;amp;camp=211189&amp;amp;creative=373489&amp;amp;creativeASIN=0735626243"&gt;&lt;IMG src="https://images-na.ssl-images-amazon.com/images/I/51IXByMCtyL._SL160_.jpg" border=0&gt;&lt;/A&gt; 
&lt;P&gt;I just searched through my old blog posts, and realized I've never talked about the new name! The "Inside" name was getting a bit diluted, with all kinds of other Inside books on the market, including some "Inside SQL Server" books from other authors through other publishers. Since I wanted the title to be really clear about what the book was covering, we decided to change the name. 
&lt;P&gt;This name change is not without precedent. Some of you may recall that there used to be a book called "Inside Windows" which morphed into "Windows Internals". 
&lt;P&gt;I have a terrific group of co-authors, including two people who are (or were very recently) on the SQL Server development team at Microsoft. My co-authors are: Paul Randal, Kimberly Tripp, Conor Cunningham, and Adam Machanic (who wrote the Tracing Chapter for Inside SQL Server 2005: Query Tuning and Optimization) 
&lt;P&gt;Thanks! 
&lt;P&gt;&lt;FONT color=#ff00ff size=4&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=9629" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/books/default.aspx">books</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/internals/default.aspx">internals</category></item><item><title>Geek City: Reading the Transaction Log</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2008/08/23/reading-the-transaction-log.aspx</link><pubDate>Sat, 23 Aug 2008 21:07:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:8506</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>46</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/8506.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=8506</wfw:commentRss><description>&lt;P&gt;Sorry, I'm not actually going to tell you how to read the log. I'm just going to talk about it... and whether it's a good thing to be able to do or not, or whether it's an absolutely crucial feature that MS needs to provide for us immediately, in a hotfix, if not sooner. Forget about fixing bugs, I want to read the log because I forgot to set up a trace beforehand....&lt;/P&gt;
&lt;P&gt;You may have noticed that my blogging frequency has fallen off. One or two of you also noticed that I am no longer writing a regular article each month for &lt;EM&gt;SQL Server Magazine&lt;/EM&gt;. Those two facts are related. I have cut back on non-essential activities to try to get my next book out as soon as possible.&amp;nbsp; It looks like I might even finish in time to get the book out on the shelves by early next year. Stay tuned... &lt;/P&gt;
&lt;P&gt;Since I couldn't bear to not do anything for &lt;EM&gt;SQL Server Magazine&lt;/EM&gt;, I started writing the commentary in the weekly email newsletter.&amp;nbsp; Actually, I do it every week but the fourth week of the month. If you like, you can sign up for this free newsletter &lt;A href="http://www.sqlmag.com/email/" target=_blank&gt;here&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;My commentary last Thursday seemed to have rattled some cages. Before I even woke up Thursday morning, there were already two comments on the site, and someone sent me a personal email about what I wrote.&amp;nbsp; By now, there are quite a few more comments. I basically wrote about the need for a log reader tool. It wasn't deeply technical; it's just a commentary after all. You can read it &lt;A href="http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076" target=_blank&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;A title=http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076 href="http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076"&gt;http://www.sqlmag.com/Articles/Index.cfm?ArticleID=100076&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;But boy, did people get upset. They called me bad names... well, if 'mediocre' can be considered a bad name...&lt;/P&gt;
&lt;P&gt;So I responded as follows:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Wow... I have never gotten so many comments so quickly about one of my articles. I must really have touched a nerve here!&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff&gt;There is a difference between the actual data rows referenced by the log, and the log format. It's the log format, and giving people full details about what is in the log, that is propriatary information. There is nothing specifically bad about giving people that information. However, calling me names because I don't stand up on a soapbox and DEMAND that MS add this functionality seems a little extreme. There are plenty of other things MS could do with the product and providing a log reader tool is way down on the list. &lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;Yes I realize it is important to some people, but there are many other ways to get this information through tracing etc. If the developer resources are limited at MS, I would much prefer they spend their time on more important stuff. MS knows it's important that people have this information, that's why they added a great deal of additional tracing capabilities in SQL Server 2008.&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff&gt;Also, keep in mind that a log reader tool wouldn't help you debug problems with logic, or with bad reports due to faulty SELECTs. If your WHERE clause was written badly, a log reader tool could tell you which rows were affected, but not WHY. You'd need a tracing tool for that. Vogelm's comment that a log reader tool would help troubleshoot bad queries from 3rd party apps is not true; you need to see the statements for that, not just the affected data.&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT color=#0000ff&gt;I do appreciate kbreneman's comment that the real problem is one of perception. MS should make clear that the transaction log is not an audit tool; if you want auditing, you need to set it up on your own, because you're the only one who knows what's important for you to capture.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(The only way to respond to comments is to write a comment of my own, and then the form insists that I rate the article I am responding to. I always feel a bit weird having to rate my own articles.) 
&lt;P&gt;Since I wrote the article, I have found out that Lumigent does have a log reader tool for SQL Server 2005, but I have heard less than stellar reviews about its ability to capture some of the more interesting datatype activities that are now possible in SQL Server 2005. And their website still doesn't list any version numbers. 
&lt;P&gt;I can't stop thinking about this, so I thought I would open up the issue to a wider audience. 
&lt;P&gt;How important do you think it is that Microsoft provide a log reader tool for us? 
&lt;P&gt;Thanks! 
&lt;P&gt;&lt;FONT color=#ff00ff size=4&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=8506" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/SQL+Server+Magazine/default.aspx">SQL Server Magazine</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Tools/default.aspx">Tools</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/transaction+log/default.aspx">transaction log</category></item><item><title>Geek City: How SQL Server Detects the Correct Versioned Rows</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2008/04/03/how-sql-server-detects-the-correct-versioned-rows.aspx</link><pubDate>Thu, 03 Apr 2008 19:16:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6033</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>4</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/6033.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=6033</wfw:commentRss><description>&lt;P&gt;Here is a question I just received from the feedback page on my web site: 
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#000080&gt;I have finished the book &amp;lt;the storage engine&amp;gt; and like it very much. I am now reading &amp;lt;query tuning and optimization&amp;gt; &lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#000080&gt;I know in the READ COMMITTED SNAPSHOT isolation, when a row is being modified in a transaction, it generates an old committed version so another transaction can read it without being blocked. &lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#000080&gt;But I don’t know how SQL Server uses SNAPSHOT isolation to prevent Phantom Read being happening. &lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#000080&gt;In SERIALIZABLE isolation the ranged key or the whole table is locked, but in SNAPSHOT isolation, it can NOT generate any committed version since the row does NOT exist at the moment. So how does it know that the newly inserted data should not be included in the second SELECT statement?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000080&gt;-Tom&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Tom is correct in that INSERTS do not generate versioned rows. However, SQL Server is able to keep track of when each change was made under snapshot isolation. Once a database is enabled for snapshots, every rows inserted, deleted or modified gets an additional 14 bytes of overhead added to it. These bytes contain 2 pieces of information. First is a row pointer to the previous committed version of the row, which is stored in the version store in tempdb. This pointer is only used for deleted and updated rows, since there will be no previous values for newly inserted rows. &lt;/P&gt;
&lt;P&gt;However, these extra bytes also include a value called XSN, or transaction sequence number, which you can think of like a timestamp for a database. Any database enabled for snapshot keeps an internal XSN value, that is incremented each time any change is made, or any snapshot select is performed. The metadata also keeps track of all active transactions, and what the XSN was when the transaction started. It uses the view &lt;EM&gt;sys.dm_tran_active_snapshot_database_transactions&lt;/EM&gt; for this.&amp;nbsp; So when you are reading data, SQL Server will look at the XSN number in each row, and not return any rows that have an XSN value greater than the XSN value at the time the transaction started.&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff size=5&gt;~Kalen&lt;/FONT&gt; 
&lt;P&gt;&lt;A href="http://www.insidesqlserver.com/"&gt;www.InsideSQLServer.com&lt;/A&gt;&lt;BR&gt;&lt;A href="http://www.sqlserverdvd.com/"&gt;www.SQLServerDVD.com&lt;/A&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=6033" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/internals/default.aspx">internals</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/snapshot+isolation/default.aspx">snapshot isolation</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Transactions/default.aspx">Transactions</category></item><item><title>Did You Know? My DVD is in Production!</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2008/02/08/my-dvd-is-in-production.aspx</link><pubDate>Fri, 08 Feb 2008 22:15:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:4987</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>2</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/4987.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=4987</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The editing for Lesson 1 is done and the production run of &lt;A href="http://sqlblog.com/blogs/kalen_delaney/archive/2007/12/15/geek-city-sql-server-internals-course-coming-soon-on-dvd.aspx" target=_blank&gt;my DVD&lt;/A&gt; has started. We're expecting shipping to start in about 2 weeks. &lt;/P&gt;
&lt;P&gt;In addition, we've extended the &lt;A class="" href="http://sqlblog.com/blogs/kalen_delaney/archive/2008/01/24/did-you-know-my-dvd-is-now-orderable.aspx" target=_blank&gt;pre-order price&lt;/A&gt; for another 5 days, so any orders that come in before Valentine's Day will get the special reduced price.&lt;/P&gt;
&lt;P&gt;Because this is taking a bit longer than we hoped, we are going to make the edited DVD available online. If you've pre-ordered, you'll be able to view the online version for free. I'll post the URL as soon as it's ready.&lt;/P&gt;
&lt;P&gt;For now, check out &lt;A href="http://dvd.kalendelaney.com/"&gt;http://DVD.KalenDelaney.com&lt;/A&gt;&lt;FONT color=#ff00ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;&lt;FONT color=#000000&gt;P.S.&lt;/FONT&gt;&amp;nbsp;&lt;FONT color=#000000&gt;Lesson 2 has already been recorded, and is now being edited.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=4987" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/metadata/default.aspx">metadata</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/seminars/default.aspx">seminars</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/training/default.aspx">training</category></item><item><title>Did You Know? I'm Going Down Under Again!</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/11/29/going-down-under-again.aspx</link><pubDate>Thu, 29 Nov 2007 20:17:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3582</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>0</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/3582.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=3582</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Most of my trips to the Southern Hemisphere have been in my summer, or their winter, which doesn't lend itself to the best weather conditions. Although on my last trip, I was able to take a week holiday with my husband and travel North to the Whitsunday Islands, where the weather was wonderful even in the middle of winter, as you can see:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height=265 src="http://sqlblog.com/blogs/kalen_delaney/WindowsLiveWriter/DidYouKnowImGoingDownUnderAgain_A588/P9020023%5B14%5D.jpg" width=354 border=0&gt;&lt;/P&gt;
&lt;P&gt;However, this time I'm going in the middle of our Northern Hemisphere winter, to the middle of the Australian summer!&lt;/P&gt;
&lt;P&gt;I will be teaching two classes for &lt;A title=WardyIT href="http://wardyit.com/Default.aspx"&gt;WardyIT&lt;/A&gt; at the end of February.&amp;nbsp; I'll be in Brisbane 18 - 22 February and Sydney 25 - 29 February. You can read more about the events &lt;A title="Kalen in Australia, February 2008" href="http://www.wardyit.com/courses/KalenDelaneyFEB08.pdf" target=_blank&gt;here&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;You can also find the &lt;A title="SQL Server 2005 Architecture Internals and Tuning" href="http://www.insidesqlserver.com/Course%20Description%20and%20Outline.htm"&gt;complete course description&lt;/A&gt; on my website, as well as my &lt;A title="Kalen's schedule" href="http://www.insidesqlserver.com/schedule.htm"&gt;complete schedule&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It will be great fun for me and all the course delegates...&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=3582" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Australia/default.aspx">Australia</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/internals/default.aspx">internals</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/training/default.aspx">training</category></item><item><title>Did You Know? SP2 does NOT limit the amount of plan cache you can have</title><link>http://www2.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</link><pubDate>Mon, 05 Nov 2007 02:39:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3214</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>10</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/3214.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=3214</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I am preparing my talk for the &lt;A title="Seminar Description: Controlling and Reusing Plans" href="http://sqlserverfaq.com/?eid=103"&gt;UK SQL Server Users Group&lt;/A&gt;&amp;nbsp;on November 16, I was going through other presentations on plan cache management. At the PASS Conference in Denver in September there was a session on management of cache, and I was surprised to find a slide that indicated there was a hard upper limit for plan cache size, and that the limit was actually decreased as of SQL Server 2005 SP2. This is not true. There is no upper limit to plan cache size, other than any upper limit you might have on total SQL Server memory. But usually we don't want to use too much memory for query plans, because it will reduce the memory available for data cache. In fact, there is a situation called 'plan cache bloat' where memory gets filled with very cheap adhoc plans that aren't reused, but take up memory space that could be much more effectively used for other purposes. It is to reduce this plan cache bloat that the caching management algorithm changed in SP2. &lt;/P&gt;
&lt;P&gt;The changes do NOT enforce an upper limit. The change actually computes a plan cache size at which SQL Server recognizes that there is memory pressure, and it will start removing plans from cache. The plans to be removed are the cheap plans that have not been reused, and this is a GOOD THING.&lt;/P&gt;
&lt;P&gt;The following explanation is based on a section in Chapter 5 of Inside &lt;EM&gt;SQL Server 2005: Query Tuning and Optimization&lt;/EM&gt;, used by permission of the author. :-)&lt;/P&gt;
&lt;P&gt;---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;When discussing memory pressure, we refer to the term ‘visible’ memory. Visible memory is that which is directly addressable in the SQL Server process’s virtual address space. On a 32-bit SQL Server instance, the maximum value for the visible memory is either 2 GB or 3 GB, depending on whether you have the /3GB flag set in your boot.ini file. Memory with addresses greater than 2 GB or 3 GB is only available indirectly, through AWE-mapped-memory. On a 64-bit SQL Server instance, ‘visible’ memory has no special meaning, as all the memory is directly addressable. In any of the discussion below, if we refer to visible target memory greater than 3 GB, keep in mind that is only possible on a 64-bit SQL Server. The term ‘target’ memory refers to the maximum amount of memory that can be committed to the SQL Server process. Target memory is the lesser of the value you have configured for ‘max server memory’ and the total amount of physical memory available to the operating system. So ‘visible target memory’ is the visible portion of the target memory. Query plans can only be stored in the non-AWE-mapped memory, which is why the concept of ‘visible’ memory is important. You can see a value for visible memory, specified as the number of 8-KB buffers, when you run the DBCC MEMORYSTATUS command. The section called ‘Buffer Counts’ displays values for Visible memory as well as Target memory. 
&lt;P&gt;SQL Server defines a ‘plan cache pressure limit’ value which varies depending on the version you’re running, and the amount of visible target memory.&amp;nbsp; The formula for determining the plan cache pressure limit changed in SQL Server 2005, Service Pack 2.&amp;nbsp;The table below&amp;nbsp;shows how to determine the plan cache pressure limit in SQL Server 2000 and 2005, and indicates the change in Service Pack 2, which reduced the pressure limit with higher amounts of memory. Be aware that these formulas are subject to change again in future service packs. 
&lt;P&gt;&lt;A href="http://sqlblog.com/blogs/kalen_delaney/WindowsLiveWriter/DidYouKnowSP2doesNOTlimittheamountofplan_10E8C/image%7B0%7D%5B3%5D.png"&gt;&lt;IMG style="BORDER-RIGHT:0px;BORDER-TOP:0px;BORDER-LEFT:0px;BORDER-BOTTOM:0px;" height=318 src="http://sqlblog.com/blogs/kalen_delaney/WindowsLiveWriter/DidYouKnowSP2doesNOTlimittheamountofplan_10E8C/image%7B0%7D_thumb%5B1%5D.png" width=610 border=0&gt;&lt;/A&gt;&amp;nbsp; 
&lt;P&gt;As an example, assume we are on SQL Server 2005, Service Pack 1, on a 64-bit SQL Server instance with 28 GB of target memory. The plan cache pressure limit would be 75% of 8GB plus 50% of the target memory over 8 GB (or 50% of 20GB), which is 6GB + 10GB or &lt;STRONG&gt;16 GB.&lt;/STRONG&gt; 
&lt;P&gt;On SQL Server 2005, Service Pack 2, on the 64-bit SQL Server instance with 28 GB of target memory, the plan cache pressure limit would be 75% of 4GB plus 10% of the target memory over 4 GB (or 10% of 24GB), which is 3GB + 2.4GB or &lt;STRONG&gt;5.4 GB&lt;/STRONG&gt;. 
&lt;P&gt;--------------------------------------------------------------- 
&lt;P&gt;There are more details about different caches and global vs local pressure, that I'm not going to go into detail about here. But to simplify, when SQL Server detects that a cache has reached 75-80% of the cache pressure limit, it will consider the SQL Server instance to be under memory pressure. When memory pressure is detected, all zero cost plans will be removed from cache and the cost of all other plans is reduced by half. 
&lt;P&gt;For the rest of the details, you can read the &lt;EM&gt;Query Tuning and Optimization&lt;/EM&gt; book. The point I wanted to make is that there is no hard limit and having memory pressure kick in is a good thing to prevent cache bloat. I have actually heard of people not upgrading to SP2 because they thought it would mean they would have less space for plans in cache. Even under memory pressure, plans that are regularly reused will NOT be removed from cache, so all you'll be doing is getting rid of the clutter, and have more room left for the important stuff. 
&lt;P&gt;Have fun! 
&lt;P&gt;&lt;FONT color=#ff00ff&gt;~Kalen&lt;/FONT&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=3214" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/internals/default.aspx">internals</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/plan+cache/default.aspx">plan cache</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/UK/default.aspx">UK</category></item><item><title>Inside SQL Server... the next book</title><link>http://www2.sqlblog.com/blogs/kalen_delaney/archive/2007/08/14/inside-sql-server-the-next-book.aspx</link><pubDate>Tue, 14 Aug 2007 18:28:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2210</guid><dc:creator>Kalen Delaney</dc:creator><slash:comments>7</slash:comments><comments>http://www2.sqlblog.com/blogs/kalen_delaney/comments/2210.aspx</comments><wfw:commentRss>http://www2.sqlblog.com/blogs/kalen_delaney/commentrss.aspx?PostID=2210</wfw:commentRss><description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last volume of &lt;EM&gt;Inside SQL Server 2005 (&lt;/EM&gt;&lt;A href="http://www.amazon.com/Inside-Microsoft-SQL-Server-2005/dp/0735621969/"&gt;&lt;EM&gt;Query Tuning and Optimization&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;)&lt;/EM&gt; is now in the hands of MS Press. This is the first time I have worked on a &lt;EM&gt;Inside&lt;/EM&gt; book as a group project, and for some strange reason I thought that meant that I could get the book done more quickly. We were desperately trying to get it done in time to be available by the PASS conference, but as the conference is in September this year, instead of the usual November, it looks like we won't make it. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;I would like to extend my heartfelt thanks to my co-authors:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Sunil Agarwal (Chapter 1: &lt;EM&gt;A Performance Troubleshooting Methodology&lt;/EM&gt;)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Adam Machanic (Chapter 2: &lt;EM&gt;Tracing and Profiling&lt;/EM&gt;)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Craig Freedman (Chapter 3: &lt;EM&gt;Query Execution&lt;/EM&gt; and Chapter 4: &lt;EM&gt;Troubleshooting Query Performance&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;Ron Talmage (Chapter 6: &lt;EM&gt;Concurrency Problems&lt;/EM&gt;)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;(I co-wrote Chapter 4, and wrote Chapter 5: &lt;EM&gt;Plan Caching and Recompilation&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;And of course, I also wish to thank all of my readers, without whom there would be no reason to write!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff00ff&gt;&lt;STRONG&gt;~Kalen&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www2.sqlblog.com/aggbug.aspx?PostID=2210" width="1" height="1"&gt;</description><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/books/default.aspx">books</category><category domain="http://www2.sqlblog.com/blogs/kalen_delaney/archive/tags/Inside+SQL+Server/default.aspx">Inside SQL Server</category></item></channel></rss>