• k.lasuy (7/19/2011)


    If i understand correct i should add the indexes in de included_columns column.

    as Nadrek mentioned, you have to take the information that dm_db_missing_index_details gives you with a grain of salt, not everything it recommends is a good idea.

    Reading your question though, maybe the DMV needs more explanation itself. The statement column is really the 3 part database.schema.table name for the index to be put on. The equality_columns lists the columns you will be indexing, included_columns lists the additional columns to put in the INCLUDE clause of the CREATE INDEX statement. This will create what's called a "covering index", since the query engine will be able to just read the index then instead of doing additional reads on the table itself. Sometimes it will recommend multiple indexes on the same table with the same equality_columns, but with no or different included_columns. Those can likely be created as 1 index with the included_columns. If it recommends an index that matches equality_columns with an index you already have, you may want to consider adding the included_columns to your existing index.