–可能不高效的非聚集索引 (writes > reads)

作者: admin 分类: 其他技术 发布时间: 2015-09-29 15:02 ė 6没有评论

–可能不高效的非聚集索引 (writes > reads)

select OBJECT_NAME(ddius.[object_id]) as [Table Name],
i.name AS [Index Name] ,
i.index_id,
user_updates as [Total Writes] ,
[user_seeks] + [user_scans] + [user_lookups] as [Total Reads],
[user_updates] – ([user_seeks] + [user_scans] + [user_lookups]) as [DIfference]
from sys.dm_db_index_usage_stats as ddius WITH (NOLOCK)
inner join sys.indexes as i WITH (NOLOCK) on ddius.[object_id] = i.[object_id]
and i.index_id = ddius.index_id
where OBJECTPROPERTY(ddius.[object_id],’IsUserTable’) = 1
and ddius.database_id = DB_ID()
and user_updates > ([user_seeks] + [user_scans] + [user_lookups])
and i.index_id > 1
order by [DIFFERENCE] DESC,
[Total Writes] DESC,
[Total Reads] ASC;

本文出自 高度PHP,转载时请注明出处及相应链接。

本文永久链接: http://ypweb.net/3714.html

0

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Ɣ回顶部