Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Indexes & Check in Expand / Collapse
Author
Message
Posted Thursday, April 17, 2014 6:19 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 673, Visits: 907
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
Post #1562888
Posted Thursday, April 17, 2014 8:26 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:51 AM
Points: 14,201, Visits: 28,530
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
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1562901
Posted Friday, April 18, 2014 10:00 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 673, Visits: 907
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
Post #1563092
Posted Friday, April 18, 2014 10:10 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 10:36 AM
Points: 31,362, Visits: 15,823
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.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1563096
Posted Friday, April 18, 2014 10:42 AM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 673, Visits: 907
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
Post #1563112
Posted Friday, April 18, 2014 11:27 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:51 AM
Points: 14,201, Visits: 28,530
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
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1563117
Posted Friday, April 18, 2014 1:21 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 11:33 AM
Points: 673, Visits: 907
Thank you. I'll follow
Post #1563152
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse