{"id":585,"date":"2011-04-04T13:12:00","date_gmt":"2011-04-04T13:12:00","guid":{"rendered":"\/blogs\/paul\/post\/Beware-of-advice-from-3rd-party-tools-around-indexes.aspx"},"modified":"2011-04-04T13:12:00","modified_gmt":"2011-04-04T13:12:00","slug":"beware-of-advice-from-3rd-party-tools-around-dropping-indexes","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/","title":{"rendered":"Beware of advice from 3rd-party tools around dropping indexes"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">(In this post I&#39;m not going to name-and-shame, as I&#39;m sure the problems will be fixed in time.)<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">I want to warn you about unthinkingly acting on advice from 3rd-party tools around dropping nonclustered indexes. One of my long-term clients recently bought and installed a new tool and has been asking me about recommendations from it concerning indexes I&#39;ve added to their system.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\"><strong>Case 1<\/strong>: recommendation to drop an index because its key is a left-based subset of another index key, without considering INCLUDEd columns<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">The first index has two narrow key columns (A, B) and is scanned as part of a join. The second index has a key of (A), plus 3 wide varchar columns as included columns, and is seeked as part of a join. The tool considered the second index to be redundant and recommended dropping it to save on index maintenance costs. Even combining the two indexes would have a strongly detrimental performance impact on the first join, and the index maintenance has a negligible effect on the system performance.<\/font>\n<\/p>\n<p>\n<font size=\"2\">In this case it turns out that the product does not consider INCLUDEd columns in the nonclustered indexes when making these recommendations &#8211; a cardinal sin in my opinion. <\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\"><strong>Case 2:<\/strong> recommendation to drop an index because it hasn&#39;t been used since the system last rebooted 10 days ago, without considering an entire business life-cycle<\/font>&nbsp;\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">In this case the index in question is used to help a once-per-month process not result in a hash join with a huge worktable that spills to tempdb. The recommendation from the tool did not even suggest waiting for an entire business life-cycle before considering dropping the index &#8211; standard advice when considering information from sys.dm_db_index_usage_stats. I&#39;d be interested to know whether index usage statistics are being persisted by the tool over system reboots so that recommendations are not given solely on post-reboot usage statistics.<\/font>\n<\/p>\n<p>\n<strong><font face=\"verdana,geneva\" size=\"2\">Summary<\/font><\/strong>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">In each of these cases I knew exactly why the index was required and the recommendation from the tool was incorrect. The client wasn&#39;t sure and so asked me.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">You need to be careful out there &#8211; just because a tool says to drop an index, it doesn&#39;t mean that the developers of the heuristic algorithms the tool is using know what they&#39;re doing, as has been shown in this case.<\/font>\n<\/p>\n<p>\n<font size=\"2\">Don&#39;t get me wrong &#8211; most tools are excellent and can save you time and money, but you need to be *extremely* careful any time dropping an index is recommended.<\/font>\n<\/p>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(In this post I&#39;m not going to name-and-shame, as I&#39;m sure the problems will be fixed in time.) I want to warn you about unthinkingly acting on advice from 3rd-party tools around dropping nonclustered indexes. One of my long-term clients recently bought and installed a new tool and has been asking me about recommendations from [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,47,95],"tags":[],"class_list":["post-585","post","type-post","status-publish","format-standard","hentry","category-bad-advice","category-indexes-from-every-angle","category-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Beware of advice from 3rd-party tools around dropping indexes - 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\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Beware of advice from 3rd-party tools around dropping indexes - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"(In this post I&#039;m not going to name-and-shame, as I&#039;m sure the problems will be fixed in time.) I want to warn you about unthinkingly acting on advice from 3rd-party tools around dropping nonclustered indexes. One of my long-term clients recently bought and installed a new tool and has been asking me about recommendations from [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-04T13:12:00+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=\"2 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\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/\",\"name\":\"Beware of advice from 3rd-party tools around dropping indexes - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2011-04-04T13:12:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Beware of advice from 3rd-party tools around dropping indexes\"}]},{\"@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":"Beware of advice from 3rd-party tools around dropping indexes - 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\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/","og_locale":"en_US","og_type":"article","og_title":"Beware of advice from 3rd-party tools around dropping indexes - Paul S. Randal","og_description":"(In this post I&#39;m not going to name-and-shame, as I&#39;m sure the problems will be fixed in time.) I want to warn you about unthinkingly acting on advice from 3rd-party tools around dropping nonclustered indexes. One of my long-term clients recently bought and installed a new tool and has been asking me about recommendations from [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/","og_site_name":"Paul S. Randal","article_published_time":"2011-04-04T13:12:00+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/","name":"Beware of advice from 3rd-party tools around dropping indexes - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2011-04-04T13:12:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/beware-of-advice-from-3rd-party-tools-around-dropping-indexes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Beware of advice from 3rd-party tools around dropping indexes"}]},{"@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\/585","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=585"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/585\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}