SELECT DB_NAME(database_id) AS [DATABASE],
equality_columns, inequality_columns,
included_columns, STATEMENT
FROM sys.dm_db_missing_index_details
ORDER BY 1
Result of above script will be generated in five columns.
- [Database] is name of database where missing index is detected
- [equality_columns] is list of columns that are used in equality comparison and index is required on these.
- [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 (e.g. Select List). And covering index on these is suggested.
- [Statement] is name of table along with column where index is missing
Also note that all this information is based on queries submitted to SQL Server query engine either by user or application. So there may be other objects where indexes are required but these are not suggested because of not being used in scripts.
For deep and detailed monitoring/analysis i would suggest Database Engine Tuning Advisor.
According to my experience, as much data will be available for such type of analysis, quality of result will be better. With small amount of usage records from above script there may be misleading results. So data should be also transfer to a permanent table for better analysis.
ReplyDelete