<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>In Recovery...</title>
    <description>Paul S. Randal on SQL Server</description>
    <link>http://www.sqlskills.com/BLOGS/PAUL/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.4.5.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.sqlskills.com/BLOGS/PAUL/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.sqlskills.com/</blogChannel:blink>
    <dc:creator>Paul S. Randal</dc:creator>
    <dc:title>In Recovery...</dc:title>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/PaulSRandal" /><feedburner:info uri="paulsrandal" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>TGIF Time Warp</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Once in a blue moon I come across something cool and it happens to be Friday, and I blog about it. Last time was drinking Guinness in Dublin and the time before was an insane driving skills video (see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/TGIF-Insane-driving-skills-clip.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;My (scary) friend and fellow SQL MVP Grant Fritchey (&lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/TGIF-Insane-driving-skills-clip.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://scarydba.wordpress.com/"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) posted the first two lines of the Time Warp from the Rocky Horror Picture Show on Twitter a few minutes ago, to which I responded with the next two lines. They&amp;#39;re burned into my brain and I blame my parents.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;My Mother used to run a drama school in Scotland when I was a kid (Helensburgh Theatre Workshop) and in the bi-annual shows someone would always &amp;quot;accidentally&amp;quot; says &amp;quot;I&amp;#39;m lucky, you&amp;#39;re lucky, we&amp;#39;re all LUCKY&amp;quot;. Then the clock chimes would start and my Mum and Dad (dressed as Magenta and Riff-Raff) would come on stage and everyone would do the whole Time Warp song. Fond memories, and yes, my family is very outgoing (and strange :-)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In homage to them, Richard O&amp;#39;Brien and Tim Curry, here&amp;#39;s a YouTube link to the movie version of the song. Wonderful! (Safe for work btw).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.youtube.com/watch?v=yarYjuN-m8I"&gt;&lt;font face="verdana,geneva" size="2"&gt;http://www.youtube.com/watch?v=yarYjuN-m8I&lt;/font&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;It&amp;#39;s just a jump to the left!&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;(Twitter @paulrandal)&lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/JObitiz569w" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/JObitiz569w/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/TGIF-Time-Warp.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=acb6b229-198c-43ce-ae43-da119dafca87</guid>
      <pubDate>Fri, 12 Mar 2010 12:17:00 -0700</pubDate>
      <category>Personal</category>
      <category>TGIF</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=acb6b229-198c-43ce-ae43-da119dafca87</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=acb6b229-198c-43ce-ae43-da119dafca87</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/TGIF-Time-Warp.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=acb6b229-198c-43ce-ae43-da119dafca87</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=acb6b229-198c-43ce-ae43-da119dafca87</feedburner:origLink></item>
    <item>
      <title>Inside sys.dm_db_index_physical_stats</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Way back in the mists of time, at the end of the last century, I wrote &lt;font face="courier new,courier"&gt;DBCC SHOWCONTIG&lt;/font&gt; for SQL Server 2000, to complement my new invention &lt;font face="courier new,courier"&gt;DBCC INDEXDEFRAG&lt;/font&gt;. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I also used to wear shorts all the time, with luminous orange, yellow, or green socks. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Many things change - I now have (some) dress sense, for one. One other thing that changed was that DMVs came onto the scene with SQL Server 2005. &lt;font face="courier new,courier"&gt;DBCC SHOWCONTIG&lt;/font&gt; was replaced by &lt;font face="courier new,courier"&gt;sys.dm_db_index_physical_stats&lt;/font&gt;. Under the covers though, they both use the same code - and the I/O characteristics haven&amp;#39;t changed. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is a blog post I&amp;#39;ve been meaning to do for a while now, and I finally had the impetus to do it when I heard about today&amp;#39;s &lt;/font&gt;&lt;a href="http://www.straightpathsql.com/archives/2010/03/invitation-for-t-sql-tuesday-004-io/"&gt;&lt;font face="verdana,geneva" size="2"&gt;T-SQL Tuesday on I/O in general&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;being run by Mike Walsh (&lt;a href="http://twitter.com/mike_walsh"&gt;Twitter&lt;/a&gt;|&lt;a href="http://www.straightpathsql.com/"&gt;blog&lt;/a&gt;). It&amp;#39;s a neat idea so I decided to join in this time. In retrospect, reading this over before hitting &amp;#39;publish&amp;#39;, I got a bit carried away (spending two hours on this) - but it&amp;#39;s one of my babies, so I&amp;#39;m entitled to! :-) &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This isn&amp;#39;t a post about how to use DMVs in general, how to use this DMV in particular, or anything about index fragmentation. This is a blog post about how the DMV works. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;DMV is a catch-all phrase that most people (myself included) use to describe all the various utility views in SQL Server 2005 and 2008. DMV = Dynamic Management View. There&amp;#39;s a catch with the catch-all though - some of the DMVs aren&amp;#39;t views at all, they&amp;#39;re functions. A pure DMV gets info from SQL Server&amp;#39;s memory (or system tables) and displays it in some form.&amp;nbsp;A DMF, on the other hand, has to go and so some work before it can give you some results. The &lt;font face="courier new,courier"&gt;sys.dm_db_index_physical_stats&lt;/font&gt; DMV (which I&amp;#39;m going to call &amp;#39;the DMV&amp;#39; from now on) is by far the most expensive of these - but only in terms of I/O. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The idea of the DMV is to display physical attributes of indexes (and the special case of a heap)&amp;nbsp;- to do this it has to scan the pages comprising the index, calculating statistics as it goes. Many DMVs support what&amp;#39;s called &lt;em&gt;predicate pushdown&lt;/em&gt;, which means if you specify a &lt;font face="courier new,courier"&gt;WHERE&lt;/font&gt; clause, the DMV takes that into account as it prepares the information. This DMV doesn&amp;#39;t. If you ask it for only the indexes in the database that have logical fragmentation &amp;gt; 30%, it will scan all the indexes, and then just tell you about those meeting your criteria. It has to do this because it has no way of knowing which ones meet your criteria until it analyzes them - so can&amp;#39;t support predicate pushdown.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is where understanding what it&amp;#39;s doing under the covers comes in - the meat of this post.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt;&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The default operating mode of the DMV is called &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt;. Kimberly always makes fun of the equivalent option for &lt;font face="courier new,courier"&gt;DBCC SHOWCONTIG&lt;/font&gt;, which I named as a young and foolish developer - calling it&amp;nbsp;&lt;font face="courier new,courier"&gt;WITH FAST&lt;/font&gt;. Hey - it&amp;#39;s descriptive! &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode can only return the logical fragmentation of the leaf level plus the page count. It doesn&amp;#39;t actually read the leaf level. It makes use of the fact that the next level up in the index contains a key-ordered list of page IDs of the pages at the leaf level - so it&amp;#39;s trivial to examine the key-ordered list and see if the page IDs are also in allocation order or not, thus calculating logical fragmentation. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The idea behind this option is to allow you to find the fragmentation of an index by reading the minimum number of pages, i.e. in the smallest amount of time. This option can be magnitudes faster than using the &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; mode scan, and it depends on how big the index&amp;#39;s &lt;em&gt;fanout&lt;/em&gt; is. Without getting too much into the guts of indexes, the fanout is based on the index key size, and determines the number of child-page pointers an index page can hold (e.g. the number of leaf-level pages that a page in the next level up has information about). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Consider an index with a &lt;font face="courier new,courier"&gt;char(800)&lt;/font&gt; key. Each entry in a page in the level above the leaf has to include a key value (the lowest key that can possibly appear on the page being referred to), plus a page ID, plus record overhead, plus slot array entry&amp;nbsp;- so 812 bytes. So a page can only hold 8096/812 = 9 such entries. The fanout is at most 9. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Consider an index with a &lt;font face="courier new,courier"&gt;bigint&lt;/font&gt; key. Each entry is 13 bytes, so a page can hold 8096/13 = 622 entries. The fanout is at most&amp;nbsp;622, but will likely be smaller, depending on operations on the index causing fragmentation at the non-leaf levels. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For a table with 1 million pages at the leaf level, the first index will have 1 million/9 = 111112 pages at least at&amp;nbsp;the level above the leaf. The second index will have at least 1608 pages. The savings in I/O from using the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan will clearly differ based on the fanout. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I&amp;#39;ve created a 100GB clustered index (on the same hardware as I&amp;#39;m using for the &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-4-network-optimization).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;benchmarking series&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) with 13421760 leaf-level pages and a maximum fanout of 540. In reality, I populated the index using 16 concurrent threads, so there&amp;#39;s some fragmentation. The level above the leaf has 63012 pages, an effective fanout of 213. Still, the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan will read 213x less than a &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; scan, but will it be 213x faster?&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s a perfmon capture of the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan on my index: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f3%2fDMVLimited.jpg" alt="" width="781" height="266" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;There&amp;#39;s nothing special going on under the covers in a &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan - the chain of pages at the level above the leaf is read in page-linkage order, with no readahead. The perfmon capture shows: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Avg. Disk Read Queue Length&lt;/font&gt; (light blue) is a steady 1.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Avg. disk sec/Read&lt;/font&gt; (pink) is a steady 4ms.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Disk Read Bytes/sec&lt;/font&gt; (green) is roughly 14.5million.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Page reads/sec&lt;/font&gt; (dark blue) is roughly 1800.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt;&lt;/strong&gt;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; mode does two things: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Calculate fragmentation by doing a &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Calculate all other statistics by reading all pages at every level of the index&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;And so it&amp;#39;s obviously the slowest. It has to do the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan first to be able to calculate the logical fragmentation, because it reads the leaf level pages in the fastest possible way - in allocation order. &lt;font face="courier new,courier"&gt;DBCC&lt;/font&gt; has a customized read-ahead mechanism for allocation order scans that it uses for this DMV and for &lt;font face="courier new,courier"&gt;DBCC CHECK*&lt;/font&gt; commands. It&amp;#39;s *incredibly* aggressive and will hit the disks as hard as it possibly can, especially with &lt;font face="courier new,courier"&gt;DBCC CHECK*&lt;/font&gt; running in parallel. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here&amp;#39;s a perfmon capture of the &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; mode scan on my index: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f3%2fDMVDetailed.jpg" alt="" width="782" height="559" /&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Not quite as pretty as the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan, but I like it :-) Here&amp;#39;s what it&amp;#39;s showing:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Avg. Disk Read Queue Length&lt;/font&gt; (black) is in the multiple hundreds. Clearly it&amp;#39;s appetite for data is outstripping what my RAID array can do. It basically tries to saturate the I/O subsystem to get as much data as possible flowing into SQL Server.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Avg. disk sec/Read&lt;/font&gt;&amp;nbsp;(pink line at the bottom) is actually measuring in whole seconds, rather than ms. Given the disk queue length, I&amp;#39;d expect that.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;DBCC Logical Scan Bytes/sec&lt;/font&gt; (red) varies substantially as the readahead mechanism throttles up and down, but it&amp;#39;s driving anywhere up to 80MB/sec. You can see around 9:49:20 AM when it drops to zero for a few seconds.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;Readahead pages/sec&lt;/font&gt; (green) is tracking the DBCC scan. This is a buffer pool counter, the DBCC one is an Access Methods counter (the dev team I used to run during 2005 development). If I had &lt;font face="courier new,courier"&gt;Disk Read Bytes/sec&lt;/font&gt; and &lt;font face="courier new,courier"&gt;Pages reads/sec&lt;/font&gt; showing, they&amp;#39;d track the other two perfectly - I turned them off for clarity.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So the &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; mode not only reads more data, but it does it a heck of a lot more aggressively so has a much more detrimental effect on the overall I/O capabilities of the system while it&amp;#39;s running.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font face="courier new,courier" size="2"&gt;SAMPLED&lt;/font&gt;&lt;/strong&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;There is a third mode that was introduced just for the DMV. The idea is that if you have a very large table and you want an idea of some of the leaf level statistics, but you don&amp;#39;t want to take the perf hit of running a &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; scan, you can use this mode. It does:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;If the number of leaf level pages is &amp;lt; 10000, read all the pages, otherwise read every 100th pages (i.e. a 1% sample)&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;strong&gt;&lt;font face="verdana,geneva" size="2"&gt;Summary&lt;/font&gt;&lt;/strong&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;There&amp;#39;s no progress reporting from the DMV (or &lt;font face="courier new,courier"&gt;DBCC SHOWCONTIG&lt;/font&gt;) but if you look at the &lt;font face="courier new,courier"&gt;reads&lt;/font&gt; column in &lt;font face="courier new,courier"&gt;sys.dm_exec_sessions&lt;/font&gt; you can see how far through the operation it is. This method works best for &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; scans, where can compare that number against the &lt;font face="courier new,courier"&gt;in_row_data_page_count&lt;/font&gt; for the index in &lt;font face="courier new,courier"&gt;sys.dm_db_partition_stats&lt;/font&gt; (yes, you&amp;#39;ll need to mess around a bit if the index is actually partitioned).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In terms of timing, I ran all three scan modes to completion. The results:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode: 282 seconds&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;SAMPLED&lt;/font&gt; mode: 414 seconds&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; mode: 3700 seconds&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Although the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode scan read roughly 200x less than the &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; scan, it was only 13 times faster, because the readahead mechanism for the &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; scan is way more efficient than the (necessary) follow-the-page-linkages scan of the &lt;font face="courier new,courier"&gt;LIMITED&lt;/font&gt; mode.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Just for kicks, I ran a &lt;font face="courier new,courier"&gt;SELECT COUNT(*)&lt;/font&gt; on the index to see how the regular Access Methods readahead mechanism would fare - it completed in 3870 seconds - 5% slower, and it had less processing to do than the DMV. Clearly &lt;font face="courier new,courier"&gt;DBCC&lt;/font&gt; rules! :-)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Although the &lt;font face="courier new,courier"&gt;DETAILED&lt;/font&gt; mode gives the most comprehensive output, it has to do the most work. For very large indexes, this could mean that your buffer pool effectively gets flushed out by the lazy writer making space available for the DMV to read and process the pages. One of the reasons I advise people to only run the DMV on indexes they know they&amp;#39;re interested in - and better yet, run it on a restored backup of the database.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Hope this is helpful!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;PS Oh, also beware of using the SSMS fragmentation wizard. It uses a &lt;font face="courier new,courier"&gt;SAMPLED&lt;/font&gt; mode scan, but I found it impossible to cancel!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/2MbgI6GFVxg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/2MbgI6GFVxg/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Inside-sysdm_db_index_physical_stats.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=7ee038e1-c192-4a4a-9aa6-e67eece2af8b</guid>
      <pubDate>Tue, 09 Mar 2010 10:18:00 -0700</pubDate>
      <category>Database Maintenance</category>
      <category>Fragmentation</category>
      <category>Indexes From Every Angle</category>
      <category>Inside the Storage Engine</category>
      <category>Performance</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=7ee038e1-c192-4a4a-9aa6-e67eece2af8b</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=7ee038e1-c192-4a4a-9aa6-e67eece2af8b</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Inside-sysdm_db_index_physical_stats.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=7ee038e1-c192-4a4a-9aa6-e67eece2af8b</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=7ee038e1-c192-4a4a-9aa6-e67eece2af8b</feedburner:origLink></item>
    <item>
      <title>In the news: our maintenance audits get rave reviews</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Back in January I offered a &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Remote-DB-maintenance-auditing-promotion.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;promotion&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; as a way of introducing our maintenance/operations auditing services. Now I&amp;#39;ve completed a bunch of them, with some excellent results for customers. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;One international&amp;nbsp;customer, &lt;/font&gt;&lt;a href="http://www.plex.com/index.asp"&gt;&lt;font face="verdana,geneva" size="2"&gt;Plex Systems&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;, was so pleased with the outcome of my audit of their manufacturing ERP software hosting databases that they issued a &lt;/font&gt;&lt;a href="http://www.plex.com/news/news.asp?Web_Content_Key=2643"&gt;&lt;font face="verdana,geneva" size="2"&gt;press release&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;today to their industry partners and clients. Another customer, &lt;a href="http://www.hfeweb.com/"&gt;Hose and Fittings, Etc&lt;/a&gt;,&amp;nbsp;was amazed at the details and justifications&amp;nbsp;in the report I presented them - see their testimonial on the &lt;a href="http://www.sqlskills.com/pastCustomers.asp"&gt;Past Customers&lt;/a&gt; page.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Take a look at the new &lt;/font&gt;&lt;a href="http://www.sqlskills.com/auditing.asp"&gt;&lt;font face="verdana,geneva" size="2"&gt;auditing page&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; that describes how the various audits work, and &lt;/font&gt;&lt;a href="mailto:paul@sqlskills.com?Subject=Audit Enquiry"&gt;&lt;font face="verdana,geneva" size="2"&gt;let me know&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; if you want to discuss doing one - we can do it wherever you are in the world. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Thanks! &lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/AwTYtB4y1GU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/AwTYtB4y1GU/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/In-the-news-our-maintenance-audits-get-rave-reviews.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=92a35f40-c8c1-4609-abd3-b8b8c425b7e2</guid>
      <pubDate>Tue, 09 Mar 2010 08:23:00 -0700</pubDate>
      <category>Auditing</category>
      <category>Database Maintenance</category>
      <category>Involuntary DBA</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=92a35f40-c8c1-4609-abd3-b8b8c425b7e2</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=92a35f40-c8c1-4609-abd3-b8b8c425b7e2</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/In-the-news-our-maintenance-audits-get-rave-reviews.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=92a35f40-c8c1-4609-abd3-b8b8c425b7e2</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=92a35f40-c8c1-4609-abd3-b8b8c425b7e2</feedburner:origLink></item>
    <item>
      <title>Benchmarking: 1-TB table population (part 4: network optimization)</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Blog&amp;nbsp;posts in this series: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the hardware&amp;nbsp;setup I&amp;#39;m using, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-hardware-setup.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For an explanation of log growth and its effect on perf, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Interesting-case-of-watching-log-file-growth-during-a-perf-test.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;.&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the baseline performance measurements for this benchmark, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-1).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the increasing performance through log file IO optimization, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-2-optimizing-log-block-IO-size-and-how-log-IO-works).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the increasing performance through separation of data and log files, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-3-separating-data-and-log-files).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;.&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;In the &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-3-separating-data-and-log-files).aspx"&gt;&lt;font size="2"&gt;previous post&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; in the series, I&amp;nbsp;examined the effects of separating the data and log files (one file&amp;nbsp;each) to different RAID arrays. It was very obvious that&amp;nbsp;separation&amp;nbsp;gave a performance boost, and that having the&amp;nbsp;portion of the database with the highest I/O write throughput requirements on the faster array (the 8-drive 15k SCSI RAID10) produced the biggest gain. &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Now - a confession.&amp;nbsp; In the last post, when I posted it I found that moving the data an 8-drive 7.2k SATA RAID10 array was the best approach. *But* during the testing for this post, I found that one of my tests had screwed up and only half the client threads had run. You&amp;#39;ll notice in that post I went back in and edited it to explain that and update the graph and results. I&amp;#39;ve now augmented my test harness with a way to check that all client threads are running - to make sure the tests are apples to apples, rather than apples to pomegranates :-) &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So - the best I&amp;#39;ve been able to do so far with the tests is creating 1TB of data using 128 connections (each creating 1/128th TB using inserts with default values) with the single data file on an 8-drive 15k SCSI RAID array (pre-created to 1TB) and the log file on an 8-drive 7.2k SATA RAID10 array (pre-created to 256MB with 50MB autogrowth) in 20842 seconds. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Lots of people have been asking how my network is setup in these tests. Here&amp;#39;s what I&amp;#39;ve been running with (all 1GB ethernet): &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;1 NIC from a Broadcom BCM5708C NetXtreme II GigE card on the 10.x.x.x network &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;1 NIC from a Broadcom BCM5708C NetXtreme II GigE card on the 192.168.x.x network &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;2 x PowerConnect 5424 24-port iSCSI optimized switches&amp;nbsp;, with no separation of traffic &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;The 10.x.x.x server NIC connected to all iSCSI arrays &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Over the last couple of weeks I&amp;#39;ve been playing around with the network setup to make sure things are optimized, and this post will describe what I did and what effect it had. In all the tests below, I kept the dat aon the faster SCSI array and the log on the slower SATA array. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I&amp;#39;m very grateful to the help I received from Wes Brown (&lt;/font&gt;&lt;a href="http://twitter.com/WesbrownSQL"&gt;&lt;font face="verdana,geneva" size="2"&gt;twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://www.sqlservercentral.com/blogs/sqlmanofmystery/"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) and Denny Cherry (&lt;/font&gt;&lt;a href="http://twitter.com/mrdenny"&gt;&lt;font face="verdana,geneva" size="2"&gt;twitter&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;|&lt;/font&gt;&lt;a href="http://itknowledgeexchange.techtarget.com/sql-server/"&gt;&lt;font face="verdana,geneva" size="2"&gt;blog&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;) to the technical questions and WTF?s I sent (and to anyone else on twitter I may have forgotten!).&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;1) Separation of network traffic&lt;/strong&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I decided to make one of the 5424 switches dedicated to iSCSI traffic on the 10.x.x.x network and the other for general network activity, including connecting to the management ports on the MD3000s. Turns out that I didn&amp;#39;t really need to, as each 5424 can handle 48GB of throughput, way more than I&amp;#39;m generating. But hey ho, at least the wiring in the back of the 42U rack is a little tidier now :-) &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Running the 128-way test with the new configuration gave a test time of 21252 seconds, slightly slower than the best time without separation! This was the first of the WTF?s. Until I realized that I hadn&amp;#39;t actually removed any network bottleneck at all. I can&amp;#39;t explain why things are slightly slower here, so I decided to take the switches out of the equation. My suspicion is that if I ran the test ten times, I&amp;#39;d get ten different results, but within a standard deviation of the median. So - no cause for concern. (In fact, I&amp;#39;m going to try this as part of the next set of tests.) &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;2) Direct connections to the iSCSI arrays&lt;/strong&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I configured another NIC (one from an Intel PRO/1000 PT Dual Port GigE card) and then had one NIC directly connected to one of the RAID controllers on the SCSI MD3000 (only one configured volume, so no concerns about having multiple volumes suddenly switching over to a non-optimal RAID controller) and the other NIC directly connected to the SATA MD3000. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Running the 128-way test with the new configuration gave&amp;nbsp;a test&amp;nbsp;time of 21859 seconds, slower than test #1. Very surprising - I expected to get some *gain* so I looked at the peak throughput of the arrays: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;For test 1, peak SATA was 50500 bytes/sec and peak SCSI was 106012 bytes/sec.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;For test 2, peak SATA was 46923 bytes/sec and peak SCSI was 107708 bytes/sec.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Things are slower with the network bottleneck removed. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;3) Upgrading 5424 switch firmware and reconfiguring&lt;/strong&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Although the 5424 switches are supposed to come iSCSI optimized, I thought I&amp;#39;d flatten them and reconfigure the. I got the latest version of the switch firmware and re-flashed both switches. I think configured the 10.x.x.x one specifically for iSCSI using &lt;/font&gt;&lt;a href="http://www.delltechcenter.com/page/Configuring+a+PowerConnect+5424+or+5448+Switch+for+use+with+an+iSCSI+storage+system"&gt;&lt;font face="verdana,geneva" size="2"&gt;this excellent Dell whitepaper&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;.&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Running the 128-way test with the new configuration gave a test time of 20745 seconds. Finally an improvement, but nothing major, and still possibly just a statistical variation. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;4) Upgrading the NIC drivers&lt;/strong&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Next I figured I&amp;#39;d bring the NICs up to the latest driver versions so upgraded all the NICs on all the servers. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Running the 128-way test with the new configuration gave a test time of 21743 seconds. Hmmm. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;5) Homogenizing the network paths&lt;/strong&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;At this point I started wondering if the Broadcom and Intel NICs had different characteristics so I decided to use the two Intel NICs for the iSCSI traffic. I also enabled jumbo frames. The Intel NICs have three setting for jumbo frames - off, 4088 bytes or 9014 bytes. The MD3000s can only go up to 9000 bytes, so I chose 4088 bytes and configured the MD3000 iSCSI ports to use the same. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Running the 128-way test with the new configuration gave a test time of 21526 seconds - nothing to write home about. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;None of the network configuration changes I made had much effect on performance, apart from removing the network bottleneck, which made performance slightly worse overall. I checked other stuff like &lt;/font&gt;&lt;a href="http://blogs.msdn.com/psssql/archive/2010/02/21/tcp-offloading-again.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;TCP offloading&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt;&lt;font face="verdana,geneva"&gt;, but that wasn&amp;#39;t enabled. My suspicion was that by removing the network bottleneck, I unmasked a SQL Server contention issue with my 128-connection test. I decided to try fewer client connections.&lt;/font&gt;&lt;font face="verdana,geneva"&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Here are the results: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f3%2f4Connections.JPG" alt="" width="485" height="273" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;There&amp;#39;s clearly a SQL Server bottleneck that&amp;#39;s being alleviated by reducing the number of connections and allowing the throughput to each array&amp;nbsp;to increase slightly. With 8 connections, SQL Server isn&amp;#39;t being driven hard enough and the elapsed time increases again, and this is reflected in the array throughput measurements too (a 10-15% drop compared to the 16-way test). One thing I forgot to do was examine the distribution of wait types while these tests were running, but my guess would be the bottleneck was in the transaction log manager. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;Summary &lt;/strong&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;By separating the network traffic and moving to two iSCSI NICs, I removed the network bottleneck I had (see the image at the bottom of the last post) and replaced it with a SQL Server bottleneck. Here&amp;#39;s a snapshot of network utilization with the new setup: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f3%2f42iSCSINICs.jpg" alt="" width="912" height="240" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the next set of tests, I&amp;#39;m going to look at the effect of altering the transaction log auto-growth size, and pre-allocation size. In all the tests so far, the log has grown from the pre-allocated 256MB to somewhere between 6.5-8GB. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Should be interesting - stay tuned. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;PS Yes, I&amp;#39;ll be doing a bunch of stuff with the Fusion-io drives too - be patient! :-) &lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/dC40JJTZvbQ" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/dC40JJTZvbQ/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-4-network-optimization).aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=362b3244-a2bf-4dd5-9f78-550310e3477e</guid>
      <pubDate>Mon, 08 Mar 2010 10:39:00 -0700</pubDate>
      <category>Benchmarking</category>
      <category>Hardware</category>
      <category>Performance</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=362b3244-a2bf-4dd5-9f78-550310e3477e</pingback:target>
      <slash:comments>6</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=362b3244-a2bf-4dd5-9f78-550310e3477e</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-4-network-optimization).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=362b3244-a2bf-4dd5-9f78-550310e3477e</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=362b3244-a2bf-4dd5-9f78-550310e3477e</feedburner:origLink></item>
    <item>
      <title>TechNet Magazine: March 2010 SQL Q&amp;A column</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The March edition of TechNet Magazine is available on the web now and has the latest installment of my regular SQL Q&amp;amp;A column. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This month&amp;#39;s topics are: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Distributed transactions and database mirroring - why they don&amp;#39;t work together&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Background processes that can cause I/Os even with no connections to the server&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;How to restore backups from a file containing multiple appended backups&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;The perennial problem of production databases being too large to restore in development&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Check it out at &lt;a href="http://technet.microsoft.com/en-us/magazine/ff458345.aspx"&gt;http://technet.microsoft.com/en-us/magazine/ff458345.aspx&lt;/a&gt;&lt;/font&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/bmrfTqTEKCI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/bmrfTqTEKCI/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/TechNet-Magazine-March-2010-SQL-QA-column.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=263c6d52-e1b2-46b1-82db-e71a4a60826e</guid>
      <pubDate>Fri, 05 Mar 2010 13:14:00 -0700</pubDate>
      <category>Backup/Restore</category>
      <category>Database Mirroring</category>
      <category>IO Subsystems</category>
      <category>Shrink</category>
      <category>TechNet Magazine</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=263c6d52-e1b2-46b1-82db-e71a4a60826e</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=263c6d52-e1b2-46b1-82db-e71a4a60826e</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/TechNet-Magazine-March-2010-SQL-QA-column.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=263c6d52-e1b2-46b1-82db-e71a4a60826e</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=263c6d52-e1b2-46b1-82db-e71a4a60826e</feedburner:origLink></item>
    <item>
      <title>New hardware to play with: Fusion-io SSDs</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Christmas comes but once a year... really? Then mine just came early on this afternoon&amp;#39;s UPS truck. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The very nice folks at &lt;/font&gt;&lt;a href="http://www.fusionio.com/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Fusion-io&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; just sent me two of their fully-loaded top-of-the-line &lt;/font&gt;&lt;a href="http://www.fusionio.com/products/iodriveduo/"&gt;&lt;font face="verdana,geneva" size="2"&gt;ioDrive Duos&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; with 640GB of solid-state flash memory in each. This is really extra-nice of them because on &lt;/font&gt;&lt;a href="http://accessories.us.dell.com/sna/productdetail.aspx?sku=A3131275&amp;amp;cs=04&amp;amp;c=us&amp;amp;l=en&amp;amp;dgc=SS&amp;amp;cid=27722&amp;amp;lid=628335"&gt;&lt;font face="verdana,geneva" size="2"&gt;Dell&amp;#39;s Small Business&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; website they&amp;#39;re currently retailing for $12800 *each*. Expensive? Yes. Worth it? That&amp;#39;s what I&amp;#39;m hoping to prove. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;There&amp;#39;s nothing like expensive, pretty hardware to get me excited... here&amp;#39;s what they look like: &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f3%2fioDrive_Duo_34_500.jpg" alt="" width="500" height="332" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Now, above I said &amp;#39;expensive&amp;#39;, and these are, but they pack some pretty amazing specs in terms of read/write bandwidth so you&amp;#39;re getting a lot of bangs for you bucks. But where does it really make sense to drop the bucks for the biggest bangs? To answer that I&amp;#39;m planning to do a whole series of blog posts as part of my benchmarking efforts to investigate which operations can benefit the most from these drives. With 1.2TB of SSD storage I&amp;#39;ll be able to plug these into one of my test systems here and run comparisons against 15k SCSI and 7.2k SATA drives. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Anyway, there&amp;#39;s a lot of hype about the speed of SSDs, and also a lot of angst about SSDs not being Enterprise-ready.&amp;nbsp;I don&amp;#39;t agree with them not being Enterprise-ready - in fact, fellow-MVP Greg Linwood, who runs (among other things) our partner company SQLskills Australia, already has a bunch of customers with Fusion-io drives deployed in their enterprises successfully. As with any critical hardware infrastructure (especially cutting-edge stuff like this), the key to success is having everything setup correctly so I&amp;#39;ll be blogging about all my experiences with them.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;To summarize, I&amp;#39;m very excited!&lt;/font&gt; &lt;font size="2"&gt;I&amp;#39;ve been wanting to get my hands on some serious SSD hardware for a couple of years now so I can do some *real* testing - it doesn&amp;#39;t get better than this!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Shoot me an email or leave a comment if there&amp;#39;s something you&amp;#39;re interested in seeing tested.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;PS Full disclosure: yes, of course Fusion-io sent me these because they&amp;#39;re getting publicity from me blogging about them, but we don&amp;#39;t have any editorial/veto agreement. I want to be able to recommend these to our enterprise clients and the only way to honestly do that is to play with them myself - so it&amp;#39;s a win-win for both of us. And you guys get to test them vicariously through me, so it&amp;#39;s a win-win for you too :-)&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Stay tuned...&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/Lw9XVWSljtg" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/Lw9XVWSljtg/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/New-hardware-to-play-with-Fusion-io-SSDs.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=0545b585-3606-4e52-9cfd-54c645064adb</guid>
      <pubDate>Wed, 03 Mar 2010 15:21:00 -0700</pubDate>
      <category>Benchmarking</category>
      <category>Hardware</category>
      <category>IO Subsystems</category>
      <category>Fusion-io</category>
      <category>SSDs</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=0545b585-3606-4e52-9cfd-54c645064adb</pingback:target>
      <slash:comments>17</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=0545b585-3606-4e52-9cfd-54c645064adb</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/New-hardware-to-play-with-Fusion-io-SSDs.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=0545b585-3606-4e52-9cfd-54c645064adb</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=0545b585-3606-4e52-9cfd-54c645064adb</feedburner:origLink></item>
    <item>
      <title>Still some spots available on the 5-day class in Boston in 3 weeks</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Our first public class of the year is just over 3 weeks away! This is the *only* public class we&amp;#39;ll be teaching in the US in 2010. There are a few spots left so book now to avoid disappointment.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;We&amp;#39;ve teamed up with our good friend&amp;nbsp;&lt;/font&gt;&lt;a href="http://sqlblog.com/blogs/adam_machanic/"&gt;&lt;font face="verdana,geneva" size="2"&gt;Adam Machanic&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; to bring a week-long custom class to the Boston area. In this class Kimberly and I take turns teaching modules and we&amp;#39;re both on hand to answer questions, do research, and try things out (and banter too!). The tag-team approach works *really well* and make the class very enjoyable and relaxed&amp;nbsp;for those attending (and for us!).&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The class will be March 29th-April 2nd&amp;nbsp;in the Le Meridien hotel in Cambridge, MA and will&lt;/font&gt;&lt;font face="verdana,geneva" size="2"&gt; cover:&lt;/font&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;On-disk structures: how the data is stored&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Index internals: how the data is organized&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Logging and recovery: how the data is protected&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Choosing the RIGHT Data Type &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Table &amp;amp; Index Partitioning Strategies&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Data Access&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Indexing Strategies &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Data and log file provisioning and management&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Tempdb&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Index and statistics maintenance&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Using backup and restore (plus internals)&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Consistency checking and disaster recovery&lt;/font&gt; 
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font size="+0"&gt;&lt;font face="verdana,geneva" size="2"&gt;You can see a much more detailed course outline &lt;/font&gt;&lt;a href="http://bostonsqltraining.com/course.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;here&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; and full details including how to register at Adam&amp;#39;s &lt;/font&gt;&lt;a href="http://bostonsqltraining.com/default.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Boston SQL Training website&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;.&lt;/font&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;We hope to see you there!&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/dw34-KtGaKw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/dw34-KtGaKw/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Still-some-spots-available-on-the-5-day-class-in-Boston-in-3-weeks.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=a9075532-c48a-450a-abaa-83f9746de257</guid>
      <pubDate>Wed, 03 Mar 2010 12:24:00 -0700</pubDate>
      <category>Classes</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=a9075532-c48a-450a-abaa-83f9746de257</pingback:target>
      <slash:comments>5</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=a9075532-c48a-450a-abaa-83f9746de257</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Still-some-spots-available-on-the-5-day-class-in-Boston-in-3-weeks.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=a9075532-c48a-450a-abaa-83f9746de257</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=a9075532-c48a-450a-abaa-83f9746de257</feedburner:origLink></item>
    <item>
      <title>Using diskpart and wmic to check disk partition alignment</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;A while ago I blogged about disk partition alignment, and how the default alignment of 31.5Kb on Windows Server 2003 can lead to enormous I/O performance problems (see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Are-your-disk-partition-offsets-RAID-stripe-sizes-and-NTFS-allocation-units-set-correctly.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;Are your disk partition offsets, RAID stripe sizes, and NTFS allocation units set correctly?&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;). We&amp;#39;ve been on-site with clients this week and that topic came up again. I thought it would be useful to do a quick blog post showing how to use the &lt;font face="courier new,courier"&gt;diskpart &lt;font face="verdana,geneva"&gt;and &lt;/font&gt;wmic&lt;/font&gt;&amp;nbsp;tools. Google&amp;nbsp;them for lots of info from the Microsoft site - but be careful not to play around with any of the destructive options on productions systems. The options I&amp;#39;m using below will not alter the disks in any way.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Note: This stuff applies to MBR disks, not GPT or dynamic disks. Although these require correct alignment too, I don&amp;#39;t have any information on how to do it for those disks. The SQLCAT team will be publishing some guidelines but has not yet done so, AFAIK. Check out the SQLCAT team whitepaper &lt;a href="http://msdn.microsoft.com/en-us/library/dd758814.aspx"&gt;Disk Partition Alignment Best Practices for SQL Server&lt;/a&gt; for full details on this topic.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Bring up a command prompt and type diskpart. You&amp;#39;ll see something like:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;C:\Users\Administrator&amp;gt;diskpart&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;Microsoft DiskPart version 6.0.6001&lt;br /&gt;
	Copyright (C) 1999-2007 Microsoft Corporation.&lt;br /&gt;
	On computer: MONKEY&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Next you need to list the logical disks that Windows knows about. Type &lt;font face="courier new,courier"&gt;list disk&lt;/font&gt;. You&amp;#39;ll see something like:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt; list disk&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;&amp;nbsp; Disk ###&amp;nbsp; Status&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Free&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dyn&amp;nbsp; Gpt&lt;br /&gt;
	&amp;nbsp; --------&amp;nbsp; ----------&amp;nbsp; -------&amp;nbsp; -------&amp;nbsp; ---&amp;nbsp; ---&lt;br /&gt;
	&amp;nbsp; Disk 0&amp;nbsp;&amp;nbsp;&amp;nbsp; Online&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 136 GB&amp;nbsp; 1434 MB&lt;br /&gt;
	&amp;nbsp; Disk 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Online&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1116 GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 B&lt;br /&gt;
	&amp;nbsp; Disk 2&amp;nbsp;&amp;nbsp;&amp;nbsp; Online&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2036 GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 B&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt;&amp;nbsp;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Disks 1 and 2 are two RAID arrays I&amp;#39;m using right now for the &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/category/Benchmarking.aspx"&gt;performance benchmarking series&lt;/a&gt; I&amp;#39;m doing. Notice that the numbers in the &lt;font face="courier new,courier"&gt;Free&lt;/font&gt; column aren&amp;#39;t correct - not sure why not.&amp;nbsp;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;To see the partitions on a disk, you need to set the &lt;font face="courier new,courier"&gt;diskpart&lt;/font&gt; focus to be that disk. Type &lt;font face="courier new,courier"&gt;select disk X&lt;/font&gt;, where X is the disk you want to focus on. You&amp;#39;ll see something like:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt; select disk 1&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;Disk 1 is now the selected disk.&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;And now you can list the partitions on the disk using &lt;font face="courier new,courier"&gt;list partition&lt;/font&gt;. You&amp;#39;ll see something like:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt; list partition&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;&amp;nbsp; Partition ###&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&lt;br /&gt;
	&amp;nbsp; -------------&amp;nbsp; ----------------&amp;nbsp; -------&amp;nbsp; -------&lt;br /&gt;
	&amp;nbsp; Partition 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Primary&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1116 GB&amp;nbsp; 1024 KB&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is the output from one of my Windows Servr 2008 servers, where the default partition offset is 1MB - which doesn&amp;#39;t lead to perf issues.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;On another Windows XP system, I get the following output:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt; select disk 0&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;Disk 0 is now the selected disk.&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt; list partition&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;&amp;nbsp; Partition ###&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Offset&lt;br /&gt;
	&amp;nbsp; -------------&amp;nbsp; ----------------&amp;nbsp; -------&amp;nbsp; -------&lt;br /&gt;
	&amp;nbsp; Partition 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Primary&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 119 GB&amp;nbsp;&amp;nbsp;&amp;nbsp; 32 KB&lt;/font&gt; 
	&lt;/p&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;DISKPART&amp;gt;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This disk isn&amp;#39;t aligned correctly. If this was a RAID array, I&amp;#39;d pay a perf penalty every time a read or write straddled a RAID stripe offset. See the blog post link at the top of this post for more details.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Unfortunately, &lt;font face="courier new,courier"&gt;diskpart&lt;/font&gt; isn&amp;#39;t always the best tool to use to get partition offsets, as it rounds up the values, and when there are multiple partitions, it can be hard to tell exactly what&amp;#39;s what, especially whtih lots of disks where you need to select each one and then list the partitions.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;In this case, use &lt;font face="courier new,courier"&gt;wmic&lt;/font&gt; to get the exact numbers. The command is as follows:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;wmic partition get BlockSize, StartingOffset, Name, Index&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For my server, I get the following output:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;BlockSize&amp;nbsp; Index&amp;nbsp; Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartingOffset&lt;br /&gt;
	512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #1, Partition #0&amp;nbsp; 1048576&lt;br /&gt;
	512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #2, Partition #0&amp;nbsp; 1048576&lt;br /&gt;
	512&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Disk #0, Partition #0&amp;nbsp; 1505755136&lt;/font&gt;&amp;nbsp; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For dynamic disks, use:&lt;/font&gt;
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="courier new,courier" size="2"&gt;dmddiag.exe -v&lt;/font&gt;&amp;nbsp;
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Now - go out to your servers and check the partition alignment - fixing this can give you up to 30-40% I/O performance boost!!&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;How do you fix it? Well, that&amp;#39;s the downside - fixing it means reformatting the disk to have the correct partition offset or moving the data to a disk that already has the correct partition offset. Remember - although Windows Server 2008 creates disks with the correct offset,&amp;nbsp;taking a disk that was created on Windows Server 2003 and attaching it&amp;nbsp;to Windows Server 2008 will have no effect on the existing partition offset.&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/nPWtF078yx0" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/nPWtF078yx0/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Using-diskpart-to-check-disk-partition-alignment.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=02a02c4a-fd28-4eed-b90e-ea643dbc8b40</guid>
      <pubDate>Sun, 28 Feb 2010 09:40:00 -0700</pubDate>
      <category>IO Subsystems</category>
      <category>Performance</category>
      <category>Tools</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=02a02c4a-fd28-4eed-b90e-ea643dbc8b40</pingback:target>
      <slash:comments>15</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=02a02c4a-fd28-4eed-b90e-ea643dbc8b40</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Using-diskpart-to-check-disk-partition-alignment.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=02a02c4a-fd28-4eed-b90e-ea643dbc8b40</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=02a02c4a-fd28-4eed-b90e-ea643dbc8b40</feedburner:origLink></item>
    <item>
      <title>Sample corrupt databases to play with</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The very worst piece of advice I ever saw on the Internet was in response to someone asking on a SQL newsgroup &lt;em&gt;&amp;#39;how can I create a corrupt database?&amp;#39;&lt;/em&gt;. The first response was:&lt;/font&gt; 
&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
	&lt;font face="verdana,geneva" size="2"&gt;&lt;em&gt;When I want to corrupt a database to play with, I go into the data center, find a hard-drive and flick the power switch on-and-off quickly a few times.&lt;/em&gt;&lt;/font&gt; 
	&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This was closely followed by a bunch of replies (including mine) saying &lt;em&gt;&lt;strong&gt;&amp;#39;Noooooooooooo!!!!&amp;#39;&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;So, for a few years now I&amp;#39;ve provided a zip file with a bunch of pre-corrupted databases in - so you can test your consistency checking jobs, and experiment with corrupt databases without having to create them yourself by destroying hard-drives, or less daft means. You can find the main zip file&amp;nbsp;at the top of&amp;nbsp;our &lt;/font&gt;&lt;a href="http://www.sqlskills.com/pastConferences.asp"&gt;&lt;font face="verdana,geneva" size="2"&gt;Past Events&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; resources page, along with a link to a &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Conference-corruption-demo-scripts-and-example-corrupt-databases.aspx"&gt;blog post&lt;/a&gt; which explains the various databases and demo scripts.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Several times I&amp;#39;ve been asked to provide SQL Server 2008 versions of the two databases which demo system table corruption. Well, that task has finally bubbled to my long-list of blog posts and website updates. There&amp;#39;s now a second, smaller zip file which has 2008-only versions of the &lt;font face="courier new,courier"&gt;DemoFatalCorruption1&lt;/font&gt; and &lt;font face="courier new,courier"&gt;DemoFatalCorruption2&lt;/font&gt; databases, which showcase corruptions that prevent &lt;font face="courier new,courier"&gt;DBCC CHECKDB&lt;/font&gt; from running.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Let me know if you have any problems (playing with the backups &lt;img src="/BLOGS/PAUL/editors/tiny_mce/plugins/emotions/images/smiley-wink.gif" border="0" alt="Wink" title="Wink" width="18" height="18" /&gt;)&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Enjoy!&lt;/font&gt; 
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/woiMGx2dPps" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/woiMGx2dPps/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Sample-corrupt-databases-to-play-with.aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=3371bb06-5180-4cb8-88a2-ca4deed42936</guid>
      <pubDate>Fri, 26 Feb 2010 12:02:00 -0700</pubDate>
      <category>CHECKDB From Every Angle</category>
      <category>Corruption</category>
      <category>DBCC</category>
      <category>Disaster Recovery</category>
      <category>Example Scripts</category>
      <category>On-Disk Structures</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=3371bb06-5180-4cb8-88a2-ca4deed42936</pingback:target>
      <slash:comments>9</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=3371bb06-5180-4cb8-88a2-ca4deed42936</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Sample-corrupt-databases-to-play-with.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=3371bb06-5180-4cb8-88a2-ca4deed42936</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=3371bb06-5180-4cb8-88a2-ca4deed42936</feedburner:origLink></item>
    <item>
      <title>Benchmarking: 1-TB table population (part 3: separating data and log files)</title>
      <description>&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Blog&amp;nbsp;posts in this series: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the hardware&amp;nbsp;setup I&amp;#39;m using, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-hardware-setup.aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the baseline performance measurements for this benchmark, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-1).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;For the increasing performance through log file IO optimization, see &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-2-optimizing-log-block-IO-size-and-how-log-IO-works).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;this post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;. &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the &lt;/font&gt;&lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-2-optimizing-log-block-IO-size-and-how-log-IO-works).aspx"&gt;&lt;font face="verdana,geneva" size="2"&gt;previous post&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt; in the series, I optimized the log block size to get better throughput on the transaction log, but it was very obvious that having the log file and the data file on the same RAID array is a bottleneck. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Over the last couple of weeks I&amp;#39;ve been running some tests with the log and data files on separate RAID arrays, and this post will explain what I&amp;#39;ve found. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The first thing I did was setup the systems for remote access so I can log in to them from anywhere in the world. This involved: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Changing the TCP/IP port that Remote Desktop listens to (&lt;/font&gt;&lt;a href="http://support.microsoft.com/kb/306759"&gt;&lt;font face="verdana,geneva" size="2"&gt;KB 306759&lt;/font&gt;&lt;/a&gt;&lt;font face="verdana,geneva" size="2"&gt;) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Allowing that port through Windows Firewall (having to perform this step wasn&amp;#39;t obvious) &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;Turning on port forwarding on our Internet-facing router for that port to the right server &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;It&amp;#39;s very cool being able to play with these servers from anywhere - and to show live servers-under-load during a class, as I could last week. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The previous two tests were performed using a single 2TB RAID-10 array comprised of 8 300GB 15k SCSI drives. The new array I added to the mix for this test is comprised of various numbers of 1TB 7.2k SATA drives. I tested: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;4 drives in a RAID-10 configuration, giving 2TB &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;6 drives in a RAID-10 configuration, giving 2TB usable &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
	&lt;li&gt;
	&lt;div&gt;
	&lt;font face="verdana,geneva" size="2"&gt;8 drives in a RAID-10 configuration, giving 2TB usable &lt;/font&gt;
	&lt;/div&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The volume size limit that the Dell MD3000i arrays allow is 2TB, so the 2nd and 3rd array configurations described above made use of extra spindles but with a lot of wasted space. In this set of tests I limited myself to a single data file, but coming up I&amp;#39;ll try multiple data files which will enable more efficient usage of the available raw disk capacity. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I used the same scripts as in the previous tests, with 128 concurrent connections each inserting 4.1KB rows in batches of 10 inserts per transaction into the same table, for a total of 1/128 TB in each connection. The data file is pre-sized to 1TB. The log file is pre-sized to 250MB, with a 50MB auto-growth increment. These are invariants from the previous test (and are also something obvious that can be changed for better performance, but that&amp;#39;s not what this set of tests was about). &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I tried the following configurations: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Log on SCSI RAID-10, data on 4-, 6-, 8-drive SATA RAID-10&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;Data on SCSI RAID-10, log on 4-, 6-, 8-drive SATA RAID-10&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;And very interesting results they are too! In the previous set of tests, the best performance I could get was 21167 seconds for test completion, with the data and log files sharing the SCSI RAID-10 array. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Moving the log to a different array&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f3LogElapsedTime.jpg" alt="" width="485" height="273" /&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f3LogThroughput.JPG" alt="" width="485" height="274" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The left-hand graph above shows that moving the log file off managed to get the time down to 20842 seconds in the best case, but that&amp;#39;s using 8 drives. The 6- and 8-drive times were basically the same - which shows that 4-drives didn&amp;#39;t provide enough IO parallelism for the load SQL Server was pushing through the array, but moving to 6 drives provided basically enough so that 8 drives didn&amp;#39;t lead to a big performance gain.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Overall, I&amp;#39;d say there was no real performance gain from moving the log file to a different array. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;As far as log disk queue lengths go, when the log was on the 4-drive array, the average log write disk queue length was in the 20s. For the 6- and 8-drive cases, the queue length dropped to low single-digits. It didn&amp;#39;t drop right down to around zero because the perfmon counter is measuring the queue length as far as Windows sees it - and the iSCSI traffic was being bottle-necked through a single NIC, as we&amp;#39;ll see later. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For data disk queue lengths, when the log was on the 4-drive array, the average data write queue length was around 5, with spikes to 20+. For the 6- and 8-drive cases, the queue length increased to an average of 10-15, with spikes to 30+. Clearly the log drive bottle-neck in the 4-drive case was lowering the overall transaction throughput, which reduced the load on the data drives. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In terms of iSCSI performance, I had the MD3000is take a 2-hour snapshot of each array&amp;#39;s performance with the varying size of the log array. The results are in the right-hand graph above. You can see that the throughput of the data array remains basically static, but the log array throughput increases with more drives thrown into the mix. Nothing stunning here. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the 4-drive case, the transaction log grew to 5.5GB but in the 6- and 8-drive cases the log grew to over 8GB - which is what I&amp;#39;d expect given the higher transaction throughput. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Moving the data to a different array&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f3DataElapsedTime.jpg" alt="" width="485" height="273" /&gt;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f3DataThroughput.JPG" alt="" width="485" height="273" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Edit 02/28/10: When performing the tests for the next post in the series, I found the results from this&amp;nbsp;test didn&amp;#39;t make sense. I went back to re-run the single-NIC tests and found what I feared - the original tests didn&amp;#39;t complete properly. The&amp;nbsp;corrected results are below.&amp;nbsp;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The left-hand graph above shows that moving the data file off managed to get the time down to&amp;nbsp;25400 seconds in the best case, but that&amp;#39;s using 8 drives. The data file&amp;#39;s throughput requirements are clearly higher than the log file&amp;#39;s (for this specific benchmark test, not as a general statement by *any means*). It&amp;#39;s clear that having the data file on the slower SATA array wasn&amp;#39;t going to lead to any better performance than having it on the SCSI array.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;As far as log disk queue lengths go, they were between 1-3 in all cases, as the 8-drive SCSI array could clearly provide enough IO throughput to satisfy the log&amp;#39;s need. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;For data disk queue lengths, when the data was on the 4-drive array, the average data write queue length was around 30, with wild spikes. For the 6- and 8-drive cases, the queue length decreased to an average of 20, and then down to 10 with spikes to 30+.&amp;nbsp;When there was no checkpoint or lazy writer activity, the write queue lengths dropped to zero, as I&amp;#39;d expect.&amp;nbsp; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In terms of iSCSI performance, I had the MD3000is take a 2-hour snapshot of each array&amp;#39;s performance with the varying size of the data array. The results are in the right-hand graph above. You can see that the throughput of the log array remains pretty static, but the data array throughput increases *dramatically* with more drives thrown into the mix. Again, nothing stunning here. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the 4-drive case, the transaction log grew to 19GB but in the 6- and 8-drive cases the log grew to around 8GB - again I&amp;#39;d expect this. It seems that for this workload, with these default checkpoint settings, and with 8GB of server memory, the log needs to be around 8GB when there&amp;#39;s adequate IO throughput. This is something I&amp;#39;ll be trying to address in future tests. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Perfmon captures&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;I took a few perfmon snapshots during the various tests to provide some details of the system performance. I&amp;#39;m not going to go into as much detail explaining the various counters and what they mean, I did that in the previous post, but I will point out interesting details. These aren&amp;#39;t necessarily meant to be representative of what you&amp;#39;ll see running similar tests - they&amp;#39;re of interesting times during the traces that I thought would be fun to look at and understand. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;1) Log file on the 6-drive SATA array&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f36driveR10log.jpg" alt="" width="751" height="535" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This graph is highlighting the &lt;font face="courier new,courier"&gt;Avg. Disk Write Queue Length&lt;/font&gt; for the K: data array (the black line). You can see that when the &lt;font face="courier new,courier"&gt;Checkpoint pages/sec&lt;/font&gt; (pink line) and &lt;font face="courier new,courier"&gt;Lazy writes/sec&lt;/font&gt; (light green line)&amp;nbsp;both drop to zero, the write&amp;nbsp;queue length drops to zero - as there&amp;#39;s no other activity on that RAID array. When either or both of these start up again, the write queue length spikes wildly. Other things to note: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;Avg. Disk Write Queue Length&lt;/font&gt; for the I: log array (the green line at the bottom) is pretty static in the low single-digits.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;Log Bytes Flushed/sec&lt;/font&gt; (the red line) tracks the Disk Write Bytes/sec for the I: log array, except during the heavy checkpoint activity at the start of the trace - this is a period of log file auto-growth.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;Pages Allocated/sec&lt;/font&gt; (the top light blue line) is fairly static, but varies wildly during the heavy checkpoint activity. This is because the log auto-growth is effectively stalling transaction throughput.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;2) Log file on the 8-drive SATA array&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f38driveR10log.jpg" alt="" width="751" height="481" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This is highlighting the &lt;font face="courier new,courier"&gt;Pages Allocated/sec&lt;/font&gt; (the black line), which remains basically static, and is a measure of the overall transaction throughput. At this point in the test, the log has auto-grown as far as it will and performance is stable. Other things to note: &lt;/font&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;Log Bytes Flushed/sec&lt;/font&gt; also remains static, as there&amp;#39;s a constant transaction workload with no interruptions for log growth, and directly correlates with the spikes and troughs in the &lt;font face="courier new,courier"&gt;Pages Allocated/sec&lt;/font&gt; counter.&lt;/font&gt;&lt;/li&gt;
	&lt;li&gt;&lt;font face="verdana,geneva" size="2"&gt;The &lt;font face="courier new,courier"&gt;Avg. Disk Write Queue Length&lt;/font&gt; for the I: log array (the bottom green line) is static.&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;3) Data on the 4-drive SATA array&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f3DataOn4Drive72R10.jpg" alt="" width="750" height="473" /&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;This represents the worst combination of array sizes and file placements, and is a pretty chaotic trace. It&amp;#39;s highlighting the &lt;font face="courier new,courier"&gt;Avg. Disk Write Queue Length&lt;/font&gt; of the I: data array (the black line) and you can see that it varies wildy between 0 and 80(!!!), clearly showing that the data file performance is hampered by under-powered RAID configuration. All other perf counters around the data array vary wildly - clearly not a recipe for high performance. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva"&gt;&lt;font size="2"&gt;&lt;strong&gt;Summary&lt;/strong&gt; &lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;There&amp;#39;s clearly a performance gain to be had from separating the data and log portions of the database in this case. However, doing so has highlighted the fact that the simple networking configuration I have is now a bottleneck.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font size="2"&gt;Here&amp;#39;s a Task Manager trace showing the network utilization during one of the tests:&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;&lt;/font&gt;
&lt;/p&gt;
&amp;nbsp;&lt;img src="http://www.sqlskills.com/BLOGS/PAUL/image.axd?picture=2010%2f2%2f31iSCSINIC.jpg" alt="" width="888" height="128" /&gt; 
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;The troughs are the constant traffic going to the log array, and the sustained peaks are when there&amp;#39;s checkpoint and/or lazy writer activity going to the data array as well.&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;In the next post, I&amp;#39;ll tune the network configuration, and then I&amp;#39;ll move on to trying multiple data files in multiple RAID arrays. &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="verdana,geneva" size="2"&gt;Hope you&amp;#39;re still enjoying the series! &lt;/font&gt;
&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/PaulSRandal/~4/kQCsnLzVSbY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/PaulSRandal/~3/kQCsnLzVSbY/post.aspx</link>
      <author>paul.nospam@nospam.sqlskills.com (paul)</author>
      <comments>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-3-separating-data-and-log-files).aspx#comment</comments>
      <guid isPermaLink="false">http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=f16a0ba8-6fd9-4ea3-998b-f696802681f0</guid>
      <pubDate>Mon, 15 Feb 2010 12:24:00 -0700</pubDate>
      <category>Benchmarking</category>
      <category>Performance</category>
      <dc:publisher>paul</dc:publisher>
      <pingback:server>http://www.sqlskills.com/BLOGS/PAUL/pingback.axd</pingback:server>
      <pingback:target>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=f16a0ba8-6fd9-4ea3-998b-f696802681f0</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://www.sqlskills.com/BLOGS/PAUL/trackback.axd?id=f16a0ba8-6fd9-4ea3-998b-f696802681f0</trackback:ping>
      <wfw:comment>http://www.sqlskills.com/BLOGS/PAUL/post/Benchmarking-1-TB-table-population-(part-3-separating-data-and-log-files).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.sqlskills.com/BLOGS/PAUL/syndication.axd?post=f16a0ba8-6fd9-4ea3-998b-f696802681f0</wfw:commentRss>
    <feedburner:origLink>http://www.sqlskills.com/BLOGS/PAUL/post.aspx?id=f16a0ba8-6fd9-4ea3-998b-f696802681f0</feedburner:origLink></item>
  </channel>
</rss>
