Unused indexes
We will end this chapter on indexes by introducing the functionality of the sys.dm_db_index_usage_stats
DMV, which you can use to learn about the operations performed by your indexes. It is especially helpful in discovering indexes that are not used by any query or are only minimally used. As we’ve already discussed, indexes that are not being used will provide no benefit to your databases but will use valuable disk space and slow your update operations, so they should be considered for removal.
The sys.dm_db_index_usage_stats
DMV stores the number of seek, scan, lookup, and update operations performed by both user and system queries, including the last time each type of operation was performed, and its counters are reset when the SQL Server service starts. Keep in mind that this DMV, in addition to nonclustered indexes, will also include heaps, listed as index_id
equal to 0, and clustered indexes, listed as index_id
equal to 1. For this section, you may want...