Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

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)

Identify Obsolete Indexes

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

Total article views: 3053 | Views in the last 30 days: 8
 
Related Articles
FORUM

Disabling index by using select query

Disabling index by using select query

SCRIPT

Queries, Plans, and Indexes

Find indexes associated with queries and vice versa. Helps figure out what procedures are using ind...

FORUM

defining query to use an existing index

defining query to use an existing index

FORUM

Query about Partition the table & Index

Query about Partition the table & Index

FORUM

Index

index

Tags
indexing    
maintenance    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones