I am using the following query to determine missing indexes:
select
db_name(d.database_id) as DatabaseName,
object_name(d.object_id) TableName,
d.index_handle as IndexHandle,
d.equality_columns as EqualityColumns,
d.inequality_columns as InequalityColumns,
d.included_columns as IncludedColumns,
d.statement as Object,
gs.user_seeks as PossibleUserSeeks,
gs.user_scans as PossibleUserScans,
gs.last_user_seek as LastPossibleUserSeek,
gs.last_user_scan as LastPossibleUserScan,
gs.system_seeks as PossibleSystemSeeks,
gs.system_scans as PossibleSystemScans
from
sys.dm_db_missing_index_groups g
join sys.dm_db_missing_index_group_stats gs on gs.group_handle = g.index_group_handle
join sys.dm_db_missing_index_details d on g.index_handle = d.index_handle
where
d.database_id = d.database_id and
d.object_id = d.object_id And
DB_NAME(d.database_id) = 'MESProduction'
My question concerns 'd.index_handle'
. MSDN describes this column as follows: Identifies a particular missing index. The identifier is unique across the server. index_handle is the key of this table.
If the index is missing, how can it be identified? And what does it mean when it says, "is the key of this table"?
Thanks very much.