Link to home
Start Free TrialLog in
Avatar of bibi92
bibi92Flag for France

asked on

DMV and Create missing indexes

Hello,

I have executed a query that use dmv for finding missing indexes.
SELECT  TOP 25
        [Total Cost]  = ROUND(avg_total_user_cost * avg_user_impact * (user_seeks + user_scans),0)
        , avg_user_impact
        , TableName = statement
        , [EqualityUsage] = equality_columns
        , [InequalityUsage] = inequality_columns
        , [Include Columns] = included_columns
FROM        sys.dm_db_missing_index_groups g
INNER JOIN    sys.dm_db_missing_index_group_stats s
       ON s.group_handle = g.index_group_handle
INNER JOIN    sys.dm_db_missing_index_details d
       ON d.index_handle = g.index_handle
ORDER BY [Total Cost] DESC;

Does I have to create the index with the columns in the equality_usage?

Thanks

bibi
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just check out the attachment to see what info you get out of it plus you can export it to Excel(like I did), sort by any column in the heading, get the SQL stmnt to create the index - is all in there and worth to use it.


MissingIndexes.xls
Avatar of bibi92

ASKER

Thanks bibi