当前位置:网站首页>SQLServer查询哪些索引利用率低
SQLServer查询哪些索引利用率低
2022-07-02 12:39:00 【51CTO】
SELECT OBJECT_NAME(S.[OBJECT_ID]) AS [OBJECT NAME],
I.[NAME] AS [INDEX NAME],
USER_SEEKS,
USER_SCANS,
USER_LOOKUPS,
USER_UPDATES
FROM SYS.DM_DB_INDEX_USAGE_STATS AS S
INNER JOIN SYS.INDEXES AS I
ON I.[OBJECT_ID] = S.[OBJECT_ID]
AND I.INDEX_ID = S.INDEX_ID
WHERE OBJECTPROPERTY(S.[OBJECT_ID],'IsUserTable') = 1
user_seeks bigint 通过用户查询执行的搜索次数。
user_scans bigint 未使用“seek”谓词的用户查询的扫描数。
user_lookups bigint 由用户查询执行的书签查找次数。
user_updates bigint 通过用户查询执行的更新次数。 这包括“插入”、“删除”和“更新”,表示未完成实际行的操作数。 例如,如果在一个语句中删除 1000 行,则此计数递增 1
该 user_updates 列是基础表或视图上插入、更新或删除操作导致的索引的维护计数器。 可以使用此视图确定应用程序极少使用的索引。 还可以使用此视图确定引发维护开销的索引。 您可能要删除引发维护开销但不用于查询或只是偶尔用于查询的索引。
USER_SEEKS,
USER_SCANS,
USER_LOOKUPS均为0,表示该索引已经很久没用使用,可以删除。
边栏推荐
猜你喜欢

PostgresSQL 流复制 主备切换 主库无读写宕机场景

XPT2046 四线电阻式触摸屏

HMS core machine learning service helps zaful users to shop conveniently

Figure database | Nepal graph v3.1.0 performance report

Recommended practice sharing of Zhilian recruitment based on Nebula graph

Idea jar package conflict troubleshooting
![[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)](/img/26/3f19d36c048e669c736e27384e0fa7.jpg)
[development environment] install Visual Studio Ultimate 2013 development environment (download software | install software | run software)

Comparison between rstan Bayesian regression model and standard linear regression model of R language MCMC

Pattern matching extraction of specific subgraphs in graphx graph Computing Practice

The outline dimension function application of small motherboard
随机推荐
可视化技术在 Nebula Graph 中的应用
Some problems about pytorch extension
/Bin/ld: cannot find -lcrypto
Introduction to database system Chapter 1 short answer questions - how was the final exam?
Locate: cannot execute stat() `/var/lib/mlocate/mlocate Db ': there is no such file or directory
如何实现十亿级离线 CSV 导入 Nebula Graph
Traversal before, during and after binary tree
The sea of stars hidden behind the nebula graph
Group by的用法
[idea] recommend an idea translation plug-in: translation "suggestions collection"
Boot 事务使用
Dimension table and fact table in data warehouse
Armv8-a programming guide MMU (4)
QVariant与Json的各种纠葛——Qt
Idea public method extraction shortcut key
win10系统升级一段时间后,内存占用过高
《大学“电路分析基础”课程实验合集.实验六》丨典型信号的观察与测量
/bin/ld: 找不到 -lcrypto
locate: 无法执行 stat () `/var/lib/mlocate/mlocate.db‘: 没有那个文件或目录
Invalid bound statement (not found)解决方法总结