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

What to do with Multiple Similar Index Reccommendations Expand / Collapse
Author
Message
Posted Monday, October 6, 2008 12:30 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 28, 2011 8:28 AM
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
Post #581308
Posted Monday, November 10, 2008 8:36 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: Monday, October 21, 2013 4:37 PM
Points: 701, 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.



Post #599914
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse