<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlcat.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>中文（简体）白皮书 - All Comments</title><link>http://sqlcat.com/whitepapers_chinese-simplified/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20910.1126)</generator><item><title>re: 面向 OLTP 应用程序的重要 SQL Server 2005 性能问题</title><link>http://sqlcat.com/whitepapers_chinese-simplified/archive/2008/10/17/oltp-sql-server-2005.aspx#593</link><pubDate>Wed, 24 Dec 2008 01:39:25 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:593</guid><dc:creator>lidong</dc:creator><description>&lt;p&gt;谢谢, 前段时间在研究SQL server的内存管理, 一直有这么个困惑, 现在终于搞明白了. &lt;/p&gt;
&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=593" width="1" height="1"&gt;</description></item><item><title>re: 面向 OLTP 应用程序的重要 SQL Server 2005 性能问题</title><link>http://sqlcat.com/whitepapers_chinese-simplified/archive/2008/10/17/oltp-sql-server-2005.aspx#592</link><pubDate>Tue, 23 Dec 2008 15:39:07 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:592</guid><dc:creator>Lindsey.allen</dc:creator><description>&lt;p&gt;Buffer Manager\Page life expectancy counter and Buffer Manager\Buffer Cache Hit Ratio counter are for data pages. Plan Cache\Cache Hit Ratio is for plan cache. &lt;/p&gt;
&lt;p&gt;Buffer Pool is utilized by many functions of SQL server, including &amp;nbsp;database pages, plan cache, locks, workspace memory. Workspace memory is the memory required by SQL Server to execute queries, including memory for hash space, index build, sorting etc. &amp;nbsp;Memory Manager\Total server memory (KB) is the counter you want to monitor. &lt;/p&gt;
&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=592" width="1" height="1"&gt;</description></item><item><title>re: 面向 OLTP 应用程序的重要 SQL Server 2005 性能问题</title><link>http://sqlcat.com/whitepapers_chinese-simplified/archive/2008/10/17/oltp-sql-server-2005.aspx#591</link><pubDate>Tue, 23 Dec 2008 08:25:10 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:591</guid><dc:creator>lidong</dc:creator><description>&lt;p&gt;谢谢, 回复的真快:)&lt;/p&gt;
&lt;p&gt;我在网上找到了一些zero cost query plan 的信息:&lt;/p&gt;
&lt;p&gt;Trace flag 2861 instructs SQL Server to keep zero cost plans in cache, which SQL Server would typically not cache (such as simple ad-hoc queries, set statements, commit transaction and others). &lt;/p&gt;
&lt;p&gt;关于第二个问题,我可能没说清楚,不好意思. &amp;nbsp;是的, 除了数据页外, 其它许多只需要一个page的内存对象都可能由buffer manager分配. &lt;/p&gt;
&lt;p&gt;那么在计算Page Life Expectancy和SQL Cache hit ratio这两个计数器时, 是否会考虑除除数据页以外的其它页的呢? 还是只考虑数据页? &lt;/p&gt;
&lt;p&gt;比如query plan 的生命周期是否会计入Page Life Expectancy, 在proc cache中为请求找到一个query plan, 那是否是递增SQL Cache hit ratio的值呢?&lt;/p&gt;
&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=591" width="1" height="1"&gt;</description></item><item><title>re: 面向 OLTP 应用程序的重要 SQL Server 2005 性能问题</title><link>http://sqlcat.com/whitepapers_chinese-simplified/archive/2008/10/17/oltp-sql-server-2005.aspx#590</link><pubDate>Tue, 23 Dec 2008 02:54:35 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:590</guid><dc:creator>Lindsey.allen</dc:creator><description>&lt;p&gt;圣诞快乐!&lt;/p&gt;
&lt;p&gt;Zero cost plan is not the same as trivial plan. We do cache some trivial plan for reuse. If you insert a couple of more rows into the same table, you will see the plan use count increases with each insert. &lt;/p&gt;
&lt;p&gt;There are other memory object and object caches in buffer pool in addition to plan cache. &lt;/p&gt;
&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=590" width="1" height="1"&gt;</description></item><item><title>re: 面向 OLTP 应用程序的重要 SQL Server 2005 性能问题</title><link>http://sqlcat.com/whitepapers_chinese-simplified/archive/2008/10/17/oltp-sql-server-2005.aspx#589</link><pubDate>Tue, 23 Dec 2008 01:59:48 GMT</pubDate><guid isPermaLink="false">e9619797-5f48-4d02-a1a8-7f300d09be66:589</guid><dc:creator>lidong</dc:creator><description>&lt;p&gt;Hi, 朱老师好啊, 很高兴在这里看到您的文章. &amp;nbsp;您上面提到SQL 2005 SP2 中不缓存零成本计划, 您指的零成本是trivial plan吗? 如果是的话,我做了个小测试:&lt;/p&gt;
&lt;p&gt;use tempdb&lt;/p&gt;
&lt;p&gt;go&lt;/p&gt;
&lt;p&gt;if exists(select * from sys.objects where name = 'table_ld')&lt;/p&gt;
&lt;p&gt;	drop table table_ld&lt;/p&gt;
&lt;p&gt;create table table_ld (col int)&lt;/p&gt;
&lt;p&gt;go&lt;/p&gt;
&lt;p&gt;dbcc freeproccache&lt;/p&gt;
&lt;p&gt;go&lt;/p&gt;
&lt;p&gt;select * from sys.dm_exec_query_optimizer_info &amp;nbsp;where counter ='trivial plan'&lt;/p&gt;
&lt;p&gt;go&lt;/p&gt;
&lt;p&gt;insert table_ld (col) values (1)&lt;/p&gt;
&lt;p&gt;go&lt;/p&gt;
&lt;p&gt;select * from sys.dm_exec_query_optimizer_info &amp;nbsp; &amp;nbsp;where counter ='trivial plan'&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;Select &amp;nbsp;st.text,cp.*&lt;/p&gt;
&lt;p&gt;from &amp;nbsp; &amp;nbsp;sys.dm_exec_cached_plans cp&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cross apply sys.dm_exec_sql_text(cp.plan_handle) st&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where st.text like '%insert%into%[[]table_ld%'&lt;/p&gt;
&lt;p&gt;结果显示trivial plan计数器加1, 但cache中还是能找到这个语句的查询计划. 我的SQLSERVER版本是9.0.3239.&lt;/p&gt;
&lt;p&gt;还想请教您第二个问题, 因为存储执行计划的cache的内存也大都是由buffer manager 分配(steal)的. 而Page Life Expectancy和SQL Cache hit ratio 这两个计数器也是位于sql server: buffer manager对象下面的. 那么这两个计数器是否也统计除了数据页面之外的其它页面呢? 比如存储query plan的proc cache的页面. &lt;/p&gt;
&lt;p&gt;顺祝圣诞快乐!&lt;/p&gt;
&lt;img src="http://sqlcat.com/aggbug.aspx?PostID=589" width="1" height="1"&gt;</description></item></channel></rss>