SQL-Server查询失效索引

SQL-Server查询失效索引
SELECT  TOP 10
        [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 Cloumns] = 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;
================================
CREATE NONCLUSTERED INDEX IX_Kq_RecordQk_QKRMan
     ON Kq_RecordQk ([QKRMan])
     include([COMP_CODE], [QKREMPID], [ApStatus])

你可能感兴趣的:(SQL-Server查询失效索引)