Indexes & Check in

  • Hi,

    I am working in the environment that we have to do indexes check in. When I run some script in a database it gives me some indexes are exactly duplicated and some with partially duplicated. When I went and see in the TFS, some of those Indexes are not checked in. Directly they created in the database before the patch. What will be the damages of duplicate indexes? If I want remove partial duplicate indexes, how can I know which Indexes is better than other indexes?

    Thanks,

    Ramana

  • The only way to know indexes with a partial match are good or not is to evaluate those indexes with your code. There's no way to say for sure based on some formula.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thanks Grant.

    Is there any way that we can tell that this Index is used by this Stored Procedure etc. Is there any chance toknow which user created the Index and what date it is created? I tried but I didn't find any direct way. Only one script is giving that on that table when the first Index is created and later it is giving modified date.

    Thanks,

    Ramana

  • If an index is used: http://blog.sqlauthority.com/2008/10/03/sql-server-2008-find-if-index-is-being-used-in-database/

    You can tell, but restarts will clear your stats.

    There's also a good piece from Kimberly Tripp on duplicate indexes that's worth reading.

    FWIW, I'd make sure all of these are checked into TFS and if you remove them, then put the removal back into TFS for the same index as the HEAD script.

  • Thanks Steve.

    So depends on the user seeks count, we can get idea about the dropping of the Index.

    Suppose if you have index1 with one key column and index2 with same key column and with 10 include columns, still in that case also you go by using user seek counts

  • ramana3327 (4/18/2014)


    Thanks Steve.

    So depends on the user seeks count, we can get idea about the dropping of the Index.

    Suppose if you have index1 with one key column and index2 with same key column and with 10 include columns, still in that case also you go by using user seek counts

    It's just hard to say. If SQL Server doesn't need any of those columns, but still thinks the first column is useful, it's more likely to get for the smaller index because it's smaller, even though they're the same. As Steve says, you can evaluate this stuff, bit it's not a hard and fast rule. There's no simple formula that points out this index is bad and this one is good. You can look to your code, your execution plans, the usage statistics, and evaluate from there.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thank you. I'll follow

Viewing 7 posts - 1 through 6 (of 6 total)

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