{"id":737,"date":"2010-03-09T10:18:00","date_gmt":"2010-03-09T10:18:00","guid":{"rendered":"\/blogs\/paul\/post\/Inside-sysdm_db_index_physical_stats.aspx"},"modified":"2019-06-12T10:51:02","modified_gmt":"2019-06-12T17:51:02","slug":"inside-sys-dm_db_index_physical_stats","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/","title":{"rendered":"Inside sys.dm_db_index_physical_stats"},"content":{"rendered":"<p><span style=\"font-family: verdana, geneva; font-size: small;\">Way back in the mists of time, at the end of the last century, I wrote <span style=\"font-family: 'courier new', courier;\">DBCC SHOWCONTIG<\/span> for SQL Server 2000, to complement my new invention <span style=\"font-family: 'courier new', courier;\">DBCC INDEXDEFRAG<\/span>. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">I also used to wear shorts all the time, with luminous orange, yellow, or green socks. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Many things change &#8211; I now have (some) dress sense, for one. One other thing that changed was that DMVs came onto the scene with SQL Server 2005. <span style=\"font-family: 'courier new', courier;\">DBCC SHOWCONTIG<\/span> was replaced by <span style=\"font-family: 'courier new', courier;\">sys.dm_db_index_physical_stats<\/span>. Under the covers though, they both use the same code &#8211; and the I\/O characteristics haven&#8217;t changed. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">This is a blog post I&#8217;ve been meaning to do for a while now, and I finally had the impetus to do it when I heard about today&#8217;s <\/span><a href=\"http:\/\/www.straightpathsql.com\/archives\/2010\/03\/invitation-for-t-sql-tuesday-004-io\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">T-SQL Tuesday on I\/O in general<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0being run by Mike Walsh (<a href=\"https:\/\/twitter.com\/mike_walsh\">Twitter<\/a>|<a href=\"http:\/\/www.straightpathsql.com\/\">blog<\/a>). It&#8217;s a neat idea so I decided to join in this time. In retrospect, reading this over before hitting &#8216;publish&#8217;, I got a bit carried away (spending two hours on this) &#8211; but it&#8217;s one of my babies, so I&#8217;m entitled to! :-) <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">This isn&#8217;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. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">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&#8217;s a catch with the catch-all though &#8211; some of the DMVs aren&#8217;t views at all, they&#8217;re functions. A pure DMV gets info from SQL Server&#8217;s memory (or system tables) and displays it in some form.\u00a0A DMF, on the other hand, has to go and so some work before it can give you some results. The <span style=\"font-family: 'courier new', courier;\">sys.dm_db_index_physical_stats<\/span> DMV (which I&#8217;m going to call &#8216;the DMV&#8217; from now on) is by far the most expensive of these &#8211; but only in terms of I\/O. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The idea of the DMV is to display physical attributes of indexes (and the special case of a heap)\u00a0&#8211; to do this it has to scan the pages comprising the index, calculating statistics as it goes. Many DMVs support what&#8217;s called <em>predicate pushdown<\/em>, which means if you specify a <span style=\"font-family: 'courier new', courier;\">WHERE<\/span> clause, the DMV takes that into account as it prepares the information. This DMV doesn&#8217;t. If you ask it for only the indexes in the database that have logical fragmentation &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 &#8211; so can&#8217;t support predicate pushdown.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">This is where understanding what it&#8217;s doing under the covers comes in &#8211; the meat of this post.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong><span style=\"font-family: 'courier new', courier;\">LIMITED<\/span><\/strong> <\/span><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The default operating mode of the DMV is called <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span>. Kimberly always makes fun of the equivalent option for <span style=\"font-family: 'courier new', courier;\">DBCC SHOWCONTIG<\/span>, which I named as a young and foolish developer &#8211; calling it\u00a0<span style=\"font-family: 'courier new', courier;\">WITH FAST<\/span>. Hey &#8211; it&#8217;s descriptive! <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode can only return the logical fragmentation of the leaf level plus the page count. It doesn&#8217;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 &#8211; so it&#8217;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. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">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 <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> mode scan, and it depends on how big the index&#8217;s <em>fanout<\/em> 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). <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Consider an index with a <span style=\"font-family: 'courier new', courier;\">char(800)<\/span> 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\u00a0&#8211; so 812 bytes. So a page can only hold 8096\/812 = 9 such entries. The fanout is at most 9. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Consider an index with a <span style=\"font-family: 'courier new', courier;\">bigint<\/span> key. Each entry is 13 bytes, so a page can hold 8096\/13 = 622 entries. The fanout is at most\u00a0622, but will likely be smaller, depending on operations on the index causing fragmentation at the non-leaf levels. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">For a table with 1 million pages at the leaf level, the first index will have 1 million\/9 = 111112 pages at least at\u00a0the level above the leaf. The second index will have at least 1608 pages. The savings in I\/O from using the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan will clearly differ based on the fanout. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">I&#8217;ve created a 100GB clustered index (on the same hardware as I&#8217;m using for the <\/span><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/benchmarking-1-tb-table-population-part-4-network-optimization\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">benchmarking series<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">) with 13421760 leaf-level pages and a maximum fanout of 540. In reality, I populated the index using 16 concurrent threads, so there&#8217;s some fragmentation. The level above the leaf has 63012 pages, an effective fanout of 213. Still, the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan will read 213x less than a <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> scan, but will it be 213x faster?<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Here&#8217;s a perfmon capture of the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan on my index: <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg\" alt=\"\" width=\"781\" height=\"266\" \/> <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">There&#8217;s nothing special going on under the covers in a <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan &#8211; the chain of pages at the level above the leaf is read in page-linkage order, with no readahead. The perfmon capture shows: <\/span><\/p>\n<ul>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Avg. Disk Read Queue Length<\/span> (light blue) is a steady 1.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Avg. disk sec\/Read<\/span> (pink) is a steady 4ms.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Disk Read Bytes\/sec<\/span> (green) is roughly 14.5million.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Page reads\/sec<\/span> (dark blue) is roughly 1800.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong><span style=\"font-family: 'courier new', courier;\">DETAILED<\/span><\/strong>\u00a0 <\/span><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">The <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> mode does two things: <\/span><\/p>\n<ul>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Calculate fragmentation by doing a <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">Calculate all other statistics by reading all pages at every level of the index<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">And so it&#8217;s obviously the slowest. It has to do the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan first to be able to calculate the logical fragmentation, because it reads the leaf level pages in the fastest possible way &#8211; in allocation order. <span style=\"font-family: 'courier new', courier;\">DBCC<\/span> has a customized read-ahead mechanism for allocation order scans that it uses for this DMV and for <span style=\"font-family: 'courier new', courier;\">DBCC CHECK*<\/span> commands. It&#8217;s *incredibly* aggressive and will hit the disks as hard as it possibly can, especially with <span style=\"font-family: 'courier new', courier;\">DBCC CHECK*<\/span> running in parallel. <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Here&#8217;s a perfmon capture of the <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> mode scan on my index: <\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0<img decoding=\"async\" src=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvdetailed.jpg\" alt=\"\" width=\"782\" height=\"559\" \/><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Not quite as pretty as the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan, but I like it :-) Here&#8217;s what it&#8217;s showing:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Avg. Disk Read Queue Length<\/span> (black) is in the multiple hundreds. Clearly its 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.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Avg. disk sec\/Read<\/span>\u00a0(pink line at the bottom) is actually measuring in whole seconds, rather than ms. Given the disk queue length, I&#8217;d expect that.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">DBCC Logical Scan Bytes\/sec<\/span> (red) varies substantially as the readahead mechanism throttles up and down, but it&#8217;s driving anywhere up to 80MB\/sec. You can see around 9:49:20 AM when it drops to zero for a few seconds.<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">Readahead pages\/sec<\/span> (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 <span style=\"font-family: 'courier new', courier;\">Disk Read Bytes\/sec<\/span> and <span style=\"font-family: 'courier new', courier;\">Pages reads\/sec<\/span> showing, they&#8217;d track the other two perfectly &#8211; I turned them off for clarity.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">So the <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> 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&#8217;s running.<\/span><\/p>\n<p><strong><span style=\"font-family: 'courier new', courier; font-size: small;\">SAMPLED<\/span><\/strong><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">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&#8217;t want to take the perf hit of running a <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> scan, you can use this mode. It does:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\">If the number of leaf level pages is &lt; 10000, read all the pages, otherwise read every 100th pages (i.e. a 1% sample)<\/span><\/li>\n<\/ul>\n<p><strong><span style=\"font-family: verdana, geneva; font-size: small;\">Summary<\/span><\/strong><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">There&#8217;s no progress reporting from the DMV (or <span style=\"font-family: 'courier new', courier;\">DBCC SHOWCONTIG<\/span>) but if you look at the <span style=\"font-family: 'courier new', courier;\">reads<\/span> column in <span style=\"font-family: 'courier new', courier;\">sys.dm_exec_sessions<\/span> you can see how far through the operation it is. This method works best for <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> scans, where can compare that number against the <span style=\"font-family: 'courier new', courier;\">in_row_data_page_count<\/span> for the index in <span style=\"font-family: 'courier new', courier;\">sys.dm_db_partition_stats<\/span> (yes, you&#8217;ll need to mess around a bit if the index is actually partitioned).<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">In terms of timing, I ran all three scan modes to completion. The results:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode: 282 seconds<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">SAMPLED<\/span> mode: 414 seconds<\/span><\/li>\n<li><span style=\"font-family: verdana, geneva; font-size: small;\"><span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> mode: 3700 seconds<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Although the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode scan read roughly 200x less than the <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> scan, it was only 13 times faster, because the readahead mechanism for the <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> scan is way more efficient than the (necessary) follow-the-page-linkages scan of the <span style=\"font-family: 'courier new', courier;\">LIMITED<\/span> mode.<\/span><\/p>\n<p><span style=\"font-size: small;\">Just for kicks, I ran a <span style=\"font-family: 'courier new', courier;\">SELECT COUNT(*)<\/span> on the index to see how the regular Access Methods readahead mechanism would fare &#8211; it completed in 3870 seconds &#8211; 5% slower, and it had less processing to do than the DMV. Clearly <span style=\"font-family: 'courier new', courier;\">DBCC<\/span> rules! :-)<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Although the <span style=\"font-family: 'courier new', courier;\">DETAILED<\/span> mode gives the most comprehensive output, it has to do the most work. For very large indexes, this could mean that your buffer pool is thrashed\u00a0by the lazy writer making space available for the DMV to read and process the pages (it won&#8217;t flush out the buffer pool though, as the pages read in for the DMV are the first ones the lazywriter will kick out again). One of the reasons I advise people to only run the DMV on indexes they know they&#8217;re interested in &#8211; and better yet, run it on a restored backup of the database.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Hope this is helpful!<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">PS Oh, also beware of using the SSMS fragmentation wizard. It uses a <span style=\"font-family: 'courier new', courier;\">SAMPLED<\/span> mode scan, but I found it impossible to cancel!<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Way back in the mists of time, at the end of the last century, I wrote DBCC SHOWCONTIG for SQL Server 2000, to complement my new invention DBCC INDEXDEFRAG. I also used to wear shorts all the time, with luminous orange, yellow, or green socks. Many things change &#8211; I now have (some) dress sense, [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,42,47,48,66,99],"tags":[],"class_list":["post-737","post","type-post","status-publish","format-standard","hentry","category-database-maintenance","category-fragmentation","category-indexes-from-every-angle","category-inside-the-storage-engine","category-performance-tuning","category-t-sql-tuesday"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Inside sys.dm_db_index_physical_stats - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Inside sys.dm_db_index_physical_stats - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"Way back in the mists of time, at the end of the last century, I wrote DBCC SHOWCONTIG for SQL Server 2000, to complement my new invention DBCC INDEXDEFRAG. I also used to wear shorts all the time, with luminous orange, yellow, or green socks. Many things change &#8211; I now have (some) dress sense, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2010-03-09T10:18:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-12T17:51:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/\",\"name\":\"Inside sys.dm_db_index_physical_stats - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg\",\"datePublished\":\"2010-03-09T10:18:00+00:00\",\"dateModified\":\"2019-06-12T17:51:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#primaryimage\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg\",\"contentUrl\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Inside sys.dm_db_index_physical_stats\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Inside sys.dm_db_index_physical_stats - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/","og_locale":"en_US","og_type":"article","og_title":"Inside sys.dm_db_index_physical_stats - Paul S. Randal","og_description":"Way back in the mists of time, at the end of the last century, I wrote DBCC SHOWCONTIG for SQL Server 2000, to complement my new invention DBCC INDEXDEFRAG. I also used to wear shorts all the time, with luminous orange, yellow, or green socks. Many things change &#8211; I now have (some) dress sense, [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/","og_site_name":"Paul S. Randal","article_published_time":"2010-03-09T10:18:00+00:00","article_modified_time":"2019-06-12T17:51:02+00:00","og_image":[{"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg","type":"","width":"","height":""}],"author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/","name":"Inside sys.dm_db_index_physical_stats - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg","datePublished":"2010-03-09T10:18:00+00:00","dateModified":"2019-06-12T17:51:02+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#primaryimage","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg","contentUrl":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-content\/uploads\/2010\/3\/dmvlimited.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/inside-sys-dm_db_index_physical_stats\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Inside sys.dm_db_index_physical_stats"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=737"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/737\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}