Not used Indexes

  • 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?

  • 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

  • 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.

  • 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

  • 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 http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply