sql server 增加索引

SELECT TOP 30
[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 index idx_siwfc on [hetecology].[dbo].[ShareInnerWfCreate]([isBelong], [usertype],[id], [workflowid], [content], [min_seclevel], [max_seclevel]);
create index idx_wfap on [hetecology].[dbo].[workflow_addinoperate]([isnode], [workflowid], [ispreadd]);
create index idx_ubmdt1 on [hetecology].[dbo].[uf_BO_MARA_dt1](id);
create index idx_otd on [hetecology].[dbo].[ofs_todo_data]([requestid], [isremark], [islasttimes]);

Leave a Comment