通过sys.dm_exec_requests看index缺失情况

本文介绍如何通过查询sys.dm_exec_requests动态管理视图来分析数据库查询的性能,特别是关注耗时较长的查询,以此判断可能存在的索引缺失情况。
摘要由CSDN通过智能技术生成

查看耗时等信息:

SELECT 
  der.session_id , --internal identifier for the running session
   der.status , --determines if the query is active or waiting
   der.start_time , --gives you an idea when the query started
   der.command , --the type of command involved
   der.database_id , --which database you're connected to
   der.user_id , --which login is running the command
   der.blocking_session_id , --session id of blocking session
   der.wait_type , -- what is the waiting session it waiting on
   der.wait_time , --how long has it been waiting
   der.last_wait_type , --what caused it to last wait
   der.cpu_time , --how much of the CPU has been used
   der.total_elapsed_time , --how long has the command been running
   der.reads , --has the command hit the disk for information
   der.writes , --how much information was written to the disk
   der.logical_reads --how many reads came out of memory
 FROMsys.dm_exec_requests AS der; 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值