0

As this article's figure 4 says, SQL Server 2005 + can return you a list of missing indexes. It stores 2 important info about missing indexes:

[EqualityUsage],[InequalityUsage]

If I have a missing index where:

[EqualityUsage]='col1',[InequalityUsage]='col2'

Should I create an index with Indexed Key Columns:

'col1,col2'

or

'col2,col1'

?

gbn
  • 422,506
  • 82
  • 585
  • 676
Jader Dias
  • 88,211
  • 155
  • 421
  • 625

2 Answers2

4

col1, col2

CREATE INDEX

To convert the information returned by sys.dm_db_missing_index_details into a CREATE INDEX statement, equality columns should be put before the inequality columns, and together they should make the key of the index. Included columns should be added to the CREATE INDEX statement using the INCLUDE clause.

gbn
  • 422,506
  • 82
  • 585
  • 676
0

if you had only one of the two to search with, which would it be? list that first

KM.
  • 101,727
  • 34
  • 178
  • 212
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. – Rostyslav Dzinko Aug 29 '12 at 20:02
  • @Rostyslav Dzinko, I strongly disagree. it provides a method to determine how to solve this and all similar future questions. – KM. Aug 29 '12 at 20:54