Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin.
Search for scripts directly from SSMS, and instantly access any saved scripts in your
SSC briefcase from the favorites tab.
Download now (direct download link)
Thank this author by sharing:
By Chad Churchwell,
Often times as an application sits in a production environment for many years, through hundreds of releases, indexes that were once created for a particular query or process are no longer used or maybe the Stored Procedure that calls them are using a different query as a result of a release. Maintaining indexes takes resources on the server, as well as space on the disk. My thoughts are why waste resources of our index maintenance plan rebuilding and updating statistics on indexes that are no longer being accessed. I came up with a query that lists candidates to be dropped based on the DMV's for indexes no longer being used. I filtered it to only nonclustered that are not Primary Keys and are not Unique Indexes. Remember this is based off of DMV's so if your SQL instance is restarted often, you could potentially drop something used in a monthly or weeky process. This is primarily geared towards servers that are up most of the time
If you run this script in a particular database, it will generate the drop statements.
This will help the ease in index maintenance and un-needed overhead on maintaining indexes that are not serving a purpose
Disabling index by using select query
Find indexes associated with queries and vice versa. Helps figure out what procedures are using ind...
defining query to use an existing index
Query about Partition the table & Index