HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Find and Remove Duplicate Indexes

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
duplicateindexesremovefindand

Problem

I have more then 1000 tables in my database. On few tables I found duplicate Indexes. Now I want to find duplicate indexes in the database and remove them. Means, if a table have 2 or more indexes on same set of columns then remove all except one.

Solution

sp_BlitzIndex from Brent Ozar will help you find and identify those:

https://www.brentozar.com/blitzindex/sp_blitzindex-duplicate-indexes/

After that You will have to check those indexes on your own and decide which of them are obsolete. This isn't a task I would try automating with any kind of script.

Context

StackExchange Database Administrators Q#141896, answer score: 4

Revisions (0)

No revisions yet.