Wednesday, May 27, 2009

Get Missing indexes on your Database(s)

Execute the command below;


SELECT DB_NAME(database_id) AS [DATABASE],
Equality_Columns, Inequality_Columns,
Included_Columns, STATEMENT
FROM sys.dm_db_missing_index_details
ORDER BY 1

where DATABASE is your DB Name where missing index(es) found.
equality_columns index is required on these columns
inequality_columns is list of columns that are used for inequality comparison and index is required on these.
included_columns is list of columns that are used in query for other than comparison and covering index on these is suggested.
Statement is name of table along with column where index is missing

No comments:

Post a Comment

 
span.fullpost {display:inline;}