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


What to do with Multiple Similar Index Reccommendations


What to do with Multiple Similar Index Reccommendations

Author
Message
james.earle
james.earle
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 11
Thanks for great sql that reveals more about SQL Server, but I have a question.

The Util_MissingIndexes stored procedure returns multiple rows that appear to be saying that I need three new indexes on the same table (Enc), but each new index is a subset of the first recommendation.

For instance, the sp returned the following three rows (shortened for this message)

1 dbo 291297339 Enc U 7530068 3412.063 [PtObjId], [EnableFinPrcsInd] [ObjId] [StsCd], [StrDate], [StrTime], [TypeCd], [StpDate] 2 7023 0 2.87829945469006 98.76 0 0 0 0 19969.321849
1 dbo 291297339 Enc U 7530068 3412.063 [PtObjId], [EnableFinPrcsInd] [ObjId] [StsCd], [StrDate], [TypeCd], [StpDate] 2 5230 0 2.87394199866952 98.79 0 0 0 0 14854.523323
1 dbo 291297339 Enc U 7530068 3412.063 [PtObjId], [EnableFinPrcsInd] [ObjId] [StrDate], [StrTime], [TypeCd] 2 4613 0 2.87726844978175 98.82 0 0 0 0 13121.904437

So my question is, if the first row says I should index the following columns in the Enc table - [StsCd], [StrDate], [StrTime], [TypeCd], [StpDate], should I create indexes for the second and third rows that would also index the exact same columns, or will SQL Server be able to find them in the first index.

Thanks
James
YeshuaAgapao
YeshuaAgapao
SSC Eights!
SSC Eights! (929 reputation)SSC Eights! (929 reputation)SSC Eights! (929 reputation)SSC Eights! (929 reputation)SSC Eights! (929 reputation)SSC Eights! (929 reputation)SSC Eights! (929 reputation)SSC Eights! (929 reputation)

Group: General Forum Members
Points: 929 Visits: 211
They are not unnecessarily recommended indexes. They are index combinations that the optimizer wanted to have but didn't.

In your case, I would make one index that encompasses all three since the seeks overlap 100% and only the includes are different. Order doesn't matter on includes.



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