Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

sys.dm_db_missing_index_columns (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns information about database table columns that are missing an index, excluding spatial indexes. sys.dm_db_missing_index_columns is a dynamic management function.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.



An integer that uniquely identifies a missing index. It can be obtained from the following dynamic management objects:

sys.dm_db_missing_index_details (Transact-SQL)

sys.dm_db_missing_index_groups (Transact-SQL)

Column name

Data type




ID of the column.



Name of the table column.



How the column is used by the query. Possible values are:




Column contributes to a predicate that expresses equality, of the form:

table.column =constant_value


Column contributes to a predicate that expresses inequality, for example, a predicate of the form:

table.column > constant_value

Any comparison operator other than "=" expresses inequality.


Column is not used to evaluate a predicate, but is used for another reason, for example, to cover a query.

Information returned by sys.dm_db_missing_index_columns is updated when a query is optimized by the query optimizer, and is not persisted. Missing index information is kept only until SQL Server is restarted. Database administrators should periodically make backup copies of the missing index information if they want to keep it after server recycling.

Transaction Consistency

If a transaction creates or drops a table, the rows containing missing index information about the dropped objects are removed from this dynamic management object, preserving transaction consistency.

Users must be granted the VIEW SERVER STATE permission or any permission that implies the VIEW SERVER STATE permission to query this dynamic management function.

The following example runs a query against the Address table and then runs a query using the sys.dm_db_missing_index_columns dynamic management view to return the table columns that are missing an index.

USE AdventureWorks2012;
SELECT City, StateProvinceID, PostalCode
FROM Person.Address
WHERE StateProvinceID = 9;
SELECT mig.*, statement AS table_name,
    column_id, column_name, column_usage
FROM sys.dm_db_missing_index_details AS mid
CROSS APPLY sys.dm_db_missing_index_columns (mid.index_handle)
INNER JOIN sys.dm_db_missing_index_groups AS mig ON mig.index_handle = mid.index_handle
ORDER BY mig.index_group_handle, mig.index_handle, column_id;

Community Additions

© 2015 Microsoft