码迷,mamicode.com
首页 > 数据库 > 详细

SQLSERVER 效能 建议加索引 EXEC sp_updatestats;

时间:2019-12-25 20:26:38      阅读:274      评论:0      收藏:0      [点我收藏+]

标签:column   date   from   creat   pac   work   where   cos   test   

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
where statement like ‘%ecology%‘
ORDER BY [Total Cost] DESC;

CREATE INDEX IDX_WFTOR ON workflow_currentoperator (id);
create index idx_wfnd on workflow_nodeform (nodeid,fieldid,isview,isedit);
create index idxofuiu on ofuserinfoupdate (username,updatestate);

SQLSERVER 效能 建议加索引 EXEC sp_updatestats;

标签:column   date   from   creat   pac   work   where   cos   test   

原文地址:https://www.cnblogs.com/Snowfun/p/12098550.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!