Warning: Constant WP_TEMP_DIR already defined in /var/www/html/blogs/joe/wp-config.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/blogs/joe/wp-config.php:93) in /var/www/html/blogs/joe/wp-includes/rest-api/class-wp-rest-server.php on line 1902
{"id":518,"date":"2011-11-11T01:20:00","date_gmt":"2011-11-11T01:20:00","guid":{"rendered":"\/blogs\/joe\/post\/What-sysdm_db_index_usage_stats-may-not-tell-you.aspx"},"modified":"2011-11-11T01:20:00","modified_gmt":"2011-11-11T01:20:00","slug":"exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/","title":{"rendered":"Exceptions – what sys.dm_db_index_usage_stats doesn’t tell you"},"content":{"rendered":"

\nI was thinking back to a conversation I had some time ago regarding cases when sys.dm_db_index_usage_stats does not<\/em> get updated after an index is used for just the statistics associated with the indexed columns.<\/font>  What makes this profession so interesting is that almost every tool we use has a "yes, but…" associated with it.  What a DMV gives with one hand it might hide with another.<\/font><\/span><\/font>\n<\/p>\n

\nWhile I recalled the conversation, I needed to double check who I had actually discussed it with.  <\/span>Admittedly, it’s a short list.  <\/span>After checking with him over email, I realized that conversation had been with MVP, Microsoft RD, MCM <\/font><\/font>Greg Low<\/u><\/font><\/a>.  <\/span>He also mentioned that <\/font>Rob Farley<\/u><\/font><\/a><\/font> once demonstrated the effect of creating a unique non-clustered index on a column which impacts the query plan but doesn’t actually register that use in sys.dm_db_index_usage_stats.<\/font><\/font>\n<\/p>\n

\nWhile the conversation stuck with me, I had never taken time to test it out.  <\/span>In this post, I’ll be testing out a different scenario, but essentially a similar situation where index column stats are used for a query (to provide more accurate estimates) – but its use results in no update to sys.dm_db_index_usage_stats.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nBefore getting to the demo, I do want to say that I still think sys.dm_db_index_usage_stats is incredibly useful for evaluating usage patterns and helping to identify indexes that aren’t pulling their weight (high cost – low benefit).<\/em>  <\/span>I also see the following scenario as an edge case – but something to most certainly be mindful of as one reason why you could all-of-the-sudden see cardinality estimate issues after dropping an index that wasn’t showing as being used at all.<\/font><\/font>\n<\/p>\n

\nIn this demo, I’m using SQL Server 2008 R2 (10.50.1617) and the AdventureWorksDW database.   <\/span>I’ll start off by disabling auto-creation of statistics (you’ll see why shortly).  <\/span>While I see auto-creation enabled more often than not, I have seen cases where it has mindfully been disabled and cases where it was disabled for no good reason at all – a topic for another day:<\/font><\/font>\n<\/p>\n

\n— Disable creation of statistics<\/font><\/font><\/span>\n<\/p>\n

\nUSE<\/font><\/font><\/span> [master]<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\nALTER<\/font><\/font><\/span> DATABASE<\/font><\/span> [AdventureWorksDW] SET<\/font><\/span> AUTO_CREATE_STATISTICS<\/font><\/span> OFF<\/font><\/span> WITH<\/font><\/span> NO_WAIT<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\nNext I’ll execute the following query against the dbo.FactInternetSales table – and I’ve enabled the “Include Actual Execution Plan” in SSMS so I can see the actual plan:<\/font><\/font>\n<\/p>\n

\nUSE<\/font><\/font><\/span> [AdventureWorksDW]<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\n<\/font><\/font><\/span>\n<\/p>\n

\n— Estimated rows (no stats on TaxAmt) = 3,853<\/font><\/font><\/span>\n<\/p>\n

\n— Actual rows (562)<\/font><\/font><\/span>\n<\/p>\n

\nSELECT<\/font><\/font><\/span> RevisionNumber<\/font><\/span><\/font>\n<\/p>\n

\nFROM<\/font><\/font><\/span> dbo.<\/font><\/span>FactInternetSales<\/font><\/span><\/font>\n<\/p>\n

\nWHERE<\/font><\/font><\/span> TaxAmt =<\/font><\/span> 5.08<\/font><\/span><\/span><\/font>\n<\/p>\n

\n<\/font><\/font>\n<\/p>\n

\nWe can check the estimated versus actual rows in SSMS, but I’ll actually show the results in SQL Sentry Plan Explorer<\/a> because I like the tabular format (and I don’t have to “hover” to see it).  <\/span>The following screen shot is from the Plan Tree tab:<\/font><\/font>\n<\/p>\n

\n\"clip_image001\"<\/a><\/span>\n<\/p>\n

\nAs you can see – the estimated rows were 3,853 versus 562 rows.  <\/span>Now recall that automatic creation of statistics are disabled, so I’m going to manually create the following index:<\/font><\/font>\n<\/p>\n

\n <\/font><\/font><\/span>— Create an index on TaxAmt (which means we also get stats)<\/font><\/font><\/span>\n<\/p>\n

\nCREATE<\/font><\/font><\/span> INDEX<\/font><\/span> IX_FactInternetSales_TaxAmt <\/font>ON<\/font><\/span><\/span><\/font>\n<\/p>\n

\ndbo.<\/font><\/span>FactInternetSales <\/font><\/span>(<\/font><\/span>TaxAmt<\/font>)<\/font><\/span><\/font><\/span>\n<\/p>\n

\nIf I re-execute the previous query against dbo.FactInternetSales, I see the following:<\/font><\/font>\n<\/p>\n

\n\"clip_image002\"<\/a><\/span>\n<\/p>\n

\nNow our estimates match the actual results.  <\/span>We have a better estimate, although notice that a table scan was still chosen (although imagine the disparity had this table had significantly more rows – and associated impact).   <\/span>But in essence, we did use the statistics associated with that index, so what about index usage stats?<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nIf I execute the following query, I get no results at all:<\/font><\/font>\n<\/p>\n

\n— Was the index used? Not according to sys.dm_db_index_usage_stats<\/font><\/font><\/span>\n<\/p>\n

\nSELECT<\/font><\/font><\/span> u.<\/font><\/span>user_seeks,<\/font><\/span> u.<\/font><\/span>user_lookups,<\/font><\/span> u.<\/font><\/span>user_scans<\/font><\/span><\/font>\n<\/p>\n

\nFROM<\/font><\/font><\/span> sys<\/font><\/span>.<\/font><\/span>dm_db_index_usage_stats<\/font><\/span> u<\/font><\/span><\/font>\n<\/p>\n

\nINNER<\/font><\/font><\/span> JOIN<\/font><\/span> sys<\/font><\/span>.<\/font><\/span>indexes<\/font><\/span> i <\/font>ON<\/font><\/span><\/span><\/font>\n<\/p>\n

\n     <\/font><\/span>u.<\/font><\/span>object_id<\/font><\/span> =<\/font><\/span> i.<\/font><\/span>object_id<\/font><\/span> <\/font>AND<\/font><\/span><\/font><\/span>\n<\/p>\n

\n     <\/font><\/span>u.<\/font><\/span>index_id =<\/font><\/span> i.<\/font><\/span>index_id<\/font><\/font><\/span>\n<\/p>\n

\nWHERE<\/font><\/font><\/span> u.<\/font><\/span>object_id<\/font><\/span>=<\/font><\/span>object_id<\/font><\/span>(<\/font><\/span>'dbo.FactInternetSales'<\/font><\/span>)<\/font><\/span> <\/font>AND<\/font><\/span><\/span><\/font>\n<\/p>\n

\n     <\/font><\/span>i.<\/font><\/span>name =<\/font><\/span> <\/font>'IX_FactInternetSales_TaxAmt'<\/font><\/span><\/font><\/span>\n<\/p>\n

\nSo let’s drop the index we just created and see what happens:<\/font><\/font>\n<\/p>\n

\nUSE<\/font><\/font><\/span> [AdventureWorksDW]<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\n<\/font><\/font><\/span>\n<\/p>\n

\nDROP<\/font><\/font><\/span> INDEX<\/font><\/span> [IX_FactInternetSales_TaxAmt] ON<\/font><\/span> [dbo].<\/font><\/span>[FactInternetSales] WITH <\/font><\/span>(<\/font><\/span> ONLINE<\/font><\/span> =<\/font><\/span> OFF<\/font><\/span> <\/font>)<\/font><\/span><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\n<\/font><\/font><\/span>\n<\/p>\n

\n— Estimated rows with index = 3,853<\/font><\/font><\/span>\n<\/p>\n

\n— Actual rows (562)<\/font><\/font><\/span>\n<\/p>\n

\nSELECT<\/font><\/font><\/span> RevisionNumber<\/font><\/span><\/font>\n<\/p>\n

\nFROM<\/font><\/font><\/span> dbo.<\/font><\/span>FactInternetSales<\/font><\/span><\/font>\n<\/p>\n

\nWHERE<\/font><\/font><\/span> TaxAmt =<\/font><\/span> 5.08<\/font><\/span><\/font>\n<\/p>\n

\nAs you may expect, we’re back to the estimation issue:<\/font><\/font>\n<\/p>\n

\n\"clip_image001[1]\"<\/a><\/span>\n<\/p>\n

\nAs a final test, let’s enable auto-creation of statistics and re-execute the query (again, with no supporting index statistics):<\/font><\/span><\/font>\n<\/p>\n

\nUSE<\/font><\/font><\/span> [master]<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\nALTER<\/font><\/font><\/span> DATABASE<\/font><\/span> [AdventureWorksDW] SET<\/font><\/span> AUTO_CREATE_STATISTICS<\/font><\/span> ON<\/font><\/span> WITH<\/font><\/span> NO_WAIT<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\n<\/font><\/font><\/span>\n<\/p>\n

\nUSE<\/font><\/font><\/span> [AdventureWorksDW]<\/font><\/span><\/font>\n<\/p>\n

\nGO<\/font><\/font><\/span>\n<\/p>\n

\n \n<\/p>\n

\n<\/font><\/font><\/span>\n<\/p>\n

\nSELECT<\/font><\/font><\/span> RevisionNumber<\/font><\/span><\/font>\n<\/p>\n

\nFROM<\/font><\/font><\/span> dbo.<\/font><\/span>FactInternetSales<\/font><\/span><\/font>\n<\/p>\n

\nWHERE<\/font><\/font><\/span> TaxAmt =<\/font><\/span> 5.08<\/font><\/span><\/font>\n<\/p>\n

\n<\/font><\/font>\n<\/p>\n

\nThe plan shows that actual versus estimated matches again (without the index) because auto-creation of statistics occurred in the background:<\/font><\/font>\n<\/p>\n

\n\"clip_image002[1]\"<\/a><\/span>\n<\/p>\n

\nAnd I can validate if auto-statistics were created as follows:<\/font><\/font>\n<\/p>\n

\nSELECT<\/font><\/font><\/span> s.<\/font><\/span>name,<\/font><\/span> STATS_DATE<\/font><\/span>(<\/font><\/span>s.<\/font><\/span>object_id<\/font><\/span>,<\/font><\/span> s.<\/font><\/span>stats_id)<\/font><\/span> auto_stats_date<\/font><\/span><\/font>\n<\/p>\n

\nFROM<\/font><\/font><\/span> sys<\/font><\/span>.<\/font><\/span>stats<\/font><\/span> s<\/font><\/span><\/font>\n<\/p>\n

\nINNER<\/font><\/font><\/span> JOIN<\/font><\/span> sys<\/font><\/span>.<\/font><\/span>stats_columns<\/font><\/span> c <\/font>ON<\/font><\/span><\/span><\/font>\n<\/p>\n

\n     <\/font><\/span>s.<\/font><\/span>stats_id =<\/font><\/span> c.<\/font><\/span>stats_id <\/font>AND<\/font><\/span><\/font><\/span>\n<\/p>\n

\n     <\/font><\/span>s.<\/font><\/span>object_id<\/font><\/span> =<\/font><\/span> c.<\/font><\/span><\/font>object_id<\/font><\/span><\/font><\/span>\n<\/p>\n

\nWHERE<\/font><\/font><\/span> s.<\/font><\/span>object_id<\/font><\/span> =<\/font><\/span> object_id<\/font><\/span>(<\/font><\/span>'dbo.FactInternetSales'<\/font><\/span>)<\/font><\/span> <\/font>AND<\/font><\/span><\/span><\/font>\n<\/p>\n

\n     <\/font><\/span>s.<\/font><\/span>auto_created =<\/font><\/span> 1 <\/font>AND<\/font><\/span><\/font><\/span>\n<\/p>\n

\n     <\/font><\/span>c.<\/font><\/span>column_id =<\/font><\/span> 20 <\/font>– TaxAmt<\/font><\/span><\/font><\/span>\n<\/p>\n

\nAnd indeed – this was the case:<\/font><\/font>\n<\/p>\n

\n\"clip_image003\"<\/a><\/span>\n<\/p>\n

\nWill this stop me from using sys.dm_db_index_usage_stats to identify high cost\/low benefit indexes?<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nAbsolutely not.  <\/span>The potential benefit of identifying and eliminating wasteful indexing is too great and this is a fantastic (but not perfect) method to use in assessing an indexes’ value.<\/font>  <\/font><\/span><\/font>\n<\/p>\n

\nHowever –<\/font><\/em> I will also be mindful of such scenarios.  <\/span>If someone tells me that plans have turned for the worse after an index cleanup operation, I’ll validate this very scenario.  <\/span>And even if I found this as the root cause, my bias would revolve around creating the needed statistics, rather than creating an index that is not used for actual data access.<\/font><\/font>\n<\/p>\n

\nWish list time… One “nice to have” for a future version of sys.dm_db_index_usage_stats would be to add a stats_lookup bigint column and a last_stats_lookup datetime column.  <\/span>I would see it as a great way to ensure we address indexes that are used exclusively for the index column statistics associated with it.<\/font><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"

I was thinking back to a conversation I had some time ago regarding cases when sys.dm_db_index_usage_stats does not get updated after an index is used for just the statistics associated with the indexed columns.  What makes this profession so interesting is that almost every tool we use has a "yes, but…" associated with it.  What […]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,28],"tags":[],"class_list":["post-518","post","type-post","status-publish","format-standard","hentry","category-indexing","category-performance"],"yoast_head":"\nExceptions - what sys.dm_db_index_usage_stats doesn't tell you - Joe Sack<\/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\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Exceptions - what sys.dm_db_index_usage_stats doesn't tell you - Joe Sack\" \/>\n<meta property=\"og:description\" content=\"I was thinking back to a conversation I had some time ago regarding cases when sys.dm_db_index_usage_stats does not get updated after an index is used for just the statistics associated with the indexed columns.  What makes this profession so interesting is that almost every tool we use has a "yes, but…" associated with it.  What […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/\" \/>\n<meta property=\"og:site_name\" content=\"Joe Sack\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-11T01:20:00+00:00\" \/>\n<meta name=\"author\" content=\"Joseph Sack\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joseph Sack\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/\",\"name\":\"Exceptions - what sys.dm_db_index_usage_stats doesn't tell you - Joe Sack\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\"},\"datePublished\":\"2011-11-11T01:20:00+00:00\",\"dateModified\":\"2011-11-11T01:20:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Indexing\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/indexing\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Exceptions – what sys.dm_db_index_usage_stats doesn’t tell you\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/\",\"name\":\"Joe Sack\",\"description\":\"SQL Server Performance Tuning, High Availability and Disaster Recovery Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648\",\"name\":\"Joseph Sack\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g\",\"caption\":\"Joseph Sack\"},\"description\":\"Joe Sack is a Principal Consultant with SQLskills. He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail and the real estate industry. Prior to joining SQLskills he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments. He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance. His areas of expertise include performance tuning, scalability, T-SQL development and high-availability. In 2006 Joe earned the \u201cMicrosoft Certified Master: SQL Server 2005\u201d certification and in 2008 he earned the \u201cMicrosoft Certified Master: SQL Server 2008\u201d certification. In 2009 he took over responsibility for the entire SQL Server Microsoft Certified Master program and held that post until 2011. He was given the SQL Server MVP award in 2013.\",\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/joe\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/josephsack\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/joe\/author\/joe\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Exceptions - what sys.dm_db_index_usage_stats doesn't tell you - Joe Sack","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\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/","og_locale":"en_US","og_type":"article","og_title":"Exceptions - what sys.dm_db_index_usage_stats doesn't tell you - Joe Sack","og_description":"I was thinking back to a conversation I had some time ago regarding cases when sys.dm_db_index_usage_stats does not get updated after an index is used for just the statistics associated with the indexed columns.  What makes this profession so interesting is that almost every tool we use has a "yes, but…" associated with it.  What […]","og_url":"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/","og_site_name":"Joe Sack","article_published_time":"2011-11-11T01:20:00+00:00","author":"Joseph Sack","twitter_misc":{"Written by":"Joseph Sack","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/","name":"Exceptions - what sys.dm_db_index_usage_stats doesn't tell you - Joe Sack","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website"},"datePublished":"2011-11-11T01:20:00+00:00","dateModified":"2011-11-11T01:20:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/exceptions-what-sys-dm_db_index_usage_stats-doesnt-tell-you\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/"},{"@type":"ListItem","position":2,"name":"Indexing","item":"https:\/\/www.sqlskills.com\/blogs\/joe\/category\/indexing\/"},{"@type":"ListItem","position":3,"name":"Exceptions – what sys.dm_db_index_usage_stats doesn’t tell you"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/joe\/","name":"Joe Sack","description":"SQL Server Performance Tuning, High Availability and Disaster Recovery Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/joe\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/533eb0113a15fb5a6e8067a49e4ae648","name":"Joseph Sack","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/joe\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a4b39a7719a6bfff1add3ec00527810734579ee114d6d983e8e68f937b77be96?s=96&d=mm&r=g","caption":"Joseph Sack"},"description":"Joe Sack is a Principal Consultant with SQLskills. He has worked as a SQL Server professional since 1997 and has supported and developed for SQL Server environments in financial services, IT consulting, manufacturing, retail and the real estate industry. Prior to joining SQLskills he worked at Microsoft as a Premier Field Engineer supporting very large enterprise customer environments. He was responsible for providing deep SQL Server advisory services, training, troubleshooting and ongoing solutions guidance. His areas of expertise include performance tuning, scalability, T-SQL development and high-availability. In 2006 Joe earned the \u201cMicrosoft Certified Master: SQL Server 2005\u201d certification and in 2008 he earned the \u201cMicrosoft Certified Master: SQL Server 2008\u201d certification. In 2009 he took over responsibility for the entire SQL Server Microsoft Certified Master program and held that post until 2011. He was given the SQL Server MVP award in 2013.","sameAs":["http:\/\/3.209.169.194\/blogs\/joe","https:\/\/twitter.com\/https:\/\/twitter.com\/josephsack"],"url":"https:\/\/www.sqlskills.com\/blogs\/joe\/author\/joe\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/comments?post=518"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/posts\/518\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/media?parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/categories?post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/joe\/wp-json\/wp\/v2\/tags?post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}