简体   繁体   中英

Why all index objects not found in sys.dm_db_index_usage_stats

We generally make Indexes by looking into query conditions eg. Columns used in query column in where condition, joins, so why all indexes have been not used, and why all index objects not found in sys.dm_db_index_usage_stats

I'm assuming you're asking why not all indexes show up in sys.dm_db_index_usage_stats. sys.dm_db_index_usage_stats only shows stats since sql server is started. So after a restart of SQL server all stats are reset to empty. If an index has not been used since the start of SQL Server it won't show up in sys.dm_db_index_usage_stats.

If your question is why not all of your indexes were used, then it is probably because SQL Server has a better execution plan for your queries (or thinks it has). Remember: indexes are no magic bullit for speeding up your queries. Don't create indexes just because you can. Kimberly Tripp has a nice blog about this: http://www.sqlskills.com/blogs/kimberly/indexes-just-because-you-can-doesnt-mean-you-should/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM