13.4. Index maintenance

The maintenance actions outlined in this section are directly associated with the corresponding analysis activities from the previous section. We'll begin with dropping unused or duplicated indexes before looking at removing index fragmentation.

13.4.1. Dropping and disabling indexes

In the previous section, we covered the use of the sys.dm_db_index_usage_stats DMV along with a number of system tables to identify indexes that are not used, used rarely, or duplicated. Once identified, the indexes are candidates for removal. The question is, how should they be removed? An index can be easily dropped using the DROP INDEX command as per this example:

DROP INDEX tablename.indexname

If the index was dropped as a result of ...

Get SQL Server 2008 Administration in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.