Using Brent Ozar's sp_BlitzIndex to highlight missing indexes (Indexaphobia: High value missing index) from several SQL Server databases with a common layout but different end-users.
Some of the suggestions involve indexes with INCLUDE(...)
and I'm not sure if I can combine several of these potential indexes - as an example say I have several sets of people (tblPeople
) being queried in slightly different ways which has produced the following suggestions;
CREATE INDEX [ix_tblPeople_ZipCode] ON [dbo].[tblPeople] ([ZipCode]);
CREATE INDEX [ix_tblPeople_ZipCode_include_A] ON [dbo].[tblPeople] ([ZipCode]) INCLUDE ([FirstName]);
CREATE INDEX [ix_tblPeople_ZipCode_include_B] ON [dbo].[tblPeople] ([ZipCode]) INCLUDE ([LastName]);
CREATE INDEX [ix_tblPeople_ZipCode_include_C] ON [dbo].[tblPeople] ([ZipCode]) INCLUDE ([BusinessName]);
Would combining these into a single index which INCLUDE
'd all those columns be useful for all three scenarios or is there a better approach?
CREATE INDEX [ix_tblPeople_ZipCode_include] ON [dbo].[tblPeople] ([ZipCode]) INCLUDE ([BusinessName], [LastName], [FirstName]);