{"id":764,"date":"2009-12-08T13:23:00","date_gmt":"2009-12-08T13:23:00","guid":{"rendered":"\/blogs\/paul\/post\/Where-do-the-Books-Online-index-fragmentation-thresholds-come-from.aspx"},"modified":"2018-10-10T08:59:46","modified_gmt":"2018-10-10T15:59:46","slug":"where-do-the-books-online-index-fragmentation-thresholds-come-from","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/","title":{"rendered":"Where do the Books Online index fragmentation thresholds come from?"},"content":{"rendered":"<p>I made them up. Yup.<\/p>\n<p>I&#8217;m talking about the guidance which is:<\/p>\n<ul>\n<li>if an index has less than 1000 pages and is in memory, don&#8217;t bother removing fragmentation<\/li>\n<li>if the index has:\n<ul>\n<li>less than 5% logical fragmentation, don&#8217;t do anything<\/li>\n<li>between 5% and 30% logical fragmentation, reorganize it (using <em>DBCC INDEXDEFRAG<\/em> or <em>ALTER INDEX &#8230; REORGANIZE<\/em>)<\/li>\n<li>more than 30% logical fragmentation, rebuild it (using <em>DBCC DBREINDEX<\/em> or <em>ALTER INDEX &#8230; REBUILD<\/em>)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>These numbers are made up. They can and will vary for you, but they&#8217;re a good starting point to work from.<\/p>\n<p>There&#8217;s been some discussion since PASS, when I confessed publicly on Twitter (during <a href=\"http:\/\/www.scarydba.com\/\">Grant Fritchey<\/a>&#8216;s session) to making them up, about whether I really said that etc etc. Yes &#8211; I really did make them up.<\/p>\n<p>Back in 1999\/2000 when I wrote <em>DBCC INDEXDEFRAG<\/em> and <em>DBCC SHOWCONTIG<\/em> for SQL Server 2000, customers wanted *some* guidance on what the thresholds should be where they should care about fragmentation or not, and how to remove it. We had to put *something* into Books Online (my favorite &#8220;it depends!&#8221; wouldn&#8217;t have been too helpful), so I talked to some customers, inside and outside Microsoft, did a bunch of experimentation, and chose these numbers as most appropriate at the time. So they&#8217;re not *really* made up &#8211; they were chosen carefully.<\/p>\n<p>They&#8217;re not set in stone &#8211; they&#8217;re a big generalization, and there are a ton of other factors that may affect your choice of threshold and fragmentation removal method (e.g. recovery model, high-availability technologies in use, log backup schedule, query workload, disk space, buffer pool memory,\u00a0and so on). I wish Microsoft would update the <a href=\"https:\/\/technet.microsoft.com\/library\/Cc966523\">old whitepaper on fragmentation<\/a> &#8211; they keep promising me they&#8217;ll get around to it.<\/p>\n<p>In the meantime, take those numbers with a pinch of salt and don&#8217;t treat them as absolute.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I made them up. Yup. I&#8217;m talking about the guidance which is: if an index has less than 1000 pages and is in memory, don&#8217;t bother removing fragmentation if the index has: less than 5% logical fragmentation, don&#8217;t do anything between 5% and 30% logical fragmentation, reorganize it (using DBCC INDEXDEFRAG or ALTER INDEX &#8230; [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,47],"tags":[],"class_list":["post-764","post","type-post","status-publish","format-standard","hentry","category-fragmentation","category-indexes-from-every-angle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Where do the Books Online index fragmentation thresholds come from? - 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\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Where do the Books Online index fragmentation thresholds come from? - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"I made them up. Yup. I&#8217;m talking about the guidance which is: if an index has less than 1000 pages and is in memory, don&#8217;t bother removing fragmentation if the index has: less than 5% logical fragmentation, don&#8217;t do anything between 5% and 30% logical fragmentation, reorganize it (using DBCC INDEXDEFRAG or ALTER INDEX &#8230; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2009-12-08T13:23:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-10T15:59:46+00:00\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/\",\"name\":\"Where do the Books Online index fragmentation thresholds come from? - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2009-12-08T13:23:00+00:00\",\"dateModified\":\"2018-10-10T15:59:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Where do the Books Online index fragmentation thresholds come from?\"}]},{\"@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":"Where do the Books Online index fragmentation thresholds come from? - 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\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/","og_locale":"en_US","og_type":"article","og_title":"Where do the Books Online index fragmentation thresholds come from? - Paul S. Randal","og_description":"I made them up. Yup. I&#8217;m talking about the guidance which is: if an index has less than 1000 pages and is in memory, don&#8217;t bother removing fragmentation if the index has: less than 5% logical fragmentation, don&#8217;t do anything between 5% and 30% logical fragmentation, reorganize it (using DBCC INDEXDEFRAG or ALTER INDEX &#8230; [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/","og_site_name":"Paul S. Randal","article_published_time":"2009-12-08T13:23:00+00:00","article_modified_time":"2018-10-10T15:59:46+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/","name":"Where do the Books Online index fragmentation thresholds come from? - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2009-12-08T13:23:00+00:00","dateModified":"2018-10-10T15:59:46+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/where-do-the-books-online-index-fragmentation-thresholds-come-from\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Where do the Books Online index fragmentation thresholds come from?"}]},{"@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\/764","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=764"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/764\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}