SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Not used Indexes


Not used Indexes

Author
Message
tt-615680
tt-615680
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6257 Visits: 1382

Dear All,


I'm trying to remove all of the indexes which are not used or never been used so I executed the query which will provide the list of indexes and I just wanted to check if it is just the following columns which should be looked at: User seek, User seeks, User scans, User Lookups and User updates?

I know that if all of the indexes are = 0, apart from the UserUpdate column means that SQL Server has not used the the index to but still needs to maintain the index; but what I'm not clear about is when to completely remove a particular index please?


John Mitchell-245523
John Mitchell-245523
SSC Guru
SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)

Group: General Forum Members
Points: 122934 Visits: 18761
tt-615680 - Monday, March 5, 2018 8:18 AM

what I'm not clear about is when to completely remove a particular index please?


That'll depend on the usage patterns of the particular database and table. If it's a table that's only used for month end reports, you shouldn't go dropping indexes if they haven't been used for two weeks. On the other hand, if it's your main order details table then you'll probably know much sooner that an index isn't of any use.

John

tt-615680
tt-615680
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6257 Visits: 1382
John Mitchell-245523 - Monday, March 5, 2018 8:22 AM
tt-615680 - Monday, March 5, 2018 8:18 AM

what I'm not clear about is when to completely remove a particular index please?


That'll depend on the usage patterns of the particular database and table. If it's a table that's only used for month end reports, you shouldn't go dropping indexes if they haven't been used for two weeks. On the other hand, if it's your main order details table then you'll probably know much sooner that an index isn't of any use.

John

The database is used for one of the main applications and not for reporting, so are you saying that I'm looking at the correct columns before there are up to 50 columns with the value of 0 for the mentioned columns apart from the User update column.

John Mitchell-245523
John Mitchell-245523
SSC Guru
SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)SSC Guru (122K reputation)

Group: General Forum Members
Points: 122934 Visits: 18761
Sounds like you have a lot of unused indexes, yes. But you need to consider how long it is since the DMVs were reset (usually the last time SQL Server was restarted). If you have so many 0s because you rebooted the server this morning, don't go dropping any indexes based on that. Conversely, it's not only indexes with no reads that may be inefficient - you may also want to consider dropping indexes with fewer reads than updates. It's not an exact science, so test before you do anything in live, and make sure you have a backout plan in case you see any unintended effects.

John
Sean Lange
Sean Lange
SSC Guru
SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)SSC Guru (236K reputation)

Group: General Forum Members
Points: 236969 Visits: 19110
Also there may be some indexes used only for things like end of year that are really important to the low usage processes.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Modens splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search