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


Indexes & Check in


Indexes & Check in

Author
Message
ramana3327
ramana3327
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2099 Visits: 2083
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
Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39964 Visits: 32653
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
ramana3327
ramana3327
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2099 Visits: 2083
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
Steve Jones
Steve Jones
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: Administrators
Points: 62699 Visits: 19111
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
My Blog: www.voiceofthedba.com
ramana3327
ramana3327
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2099 Visits: 2083
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
Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39964 Visits: 32653
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
ramana3327
ramana3327
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2099 Visits: 2083
Thank you. I'll follow
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