通过sys.dm_exec_requests看index缺失情况

查看耗时等信息:

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; 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
sys.dm_exec_requests表包括以下字段: 1. session_id:正在执行请求的会话的ID。 2. request_id:请求的唯一标识符。 3. start_time:请求开始执行的时间。 4. status:请求的当前状态。 5. command:请求的类型。 6. sql_handle:请求所使用的SQL语句的句柄。 7. statement_start_offset:请求使用的SQL语句的起始偏移量。 8. statement_end_offset:请求使用的SQL语句的结束偏移量。 9. plan_handle:请求所使用的计划的句柄。 10. database_id:请求所在的数据库的ID。 11. user_id:请求所属的用户的ID。 12. wait_type:请求正在等待的类型。 13. wait_time:请求已经等待的时间。 14. last_wait_type:请求最后等待的类型。 15. cpu_time:请求已使用的CPU时间。 16. total_elapsed_time:请求已等待的总时间。 17. reads:请求已读取的页数。 18. writes:请求已写入的页数。 19. logical_reads:请求已读取的逻辑页数。 20. text_size:请求使用的SQL语句的文本大小。 21. language:请求使用的语言。 22. date_format:请求使用的日期格式。 23. date_first:请求使用的第一个日期。 24. quoted_identifier:请求使用的引号标识符。 25. arithabort:请求使用的算术终止标志。 26. ansi_null_dflt_on:请求使用的ANSI_NULL_DFLT_ON标志。 27. ansi_defaults:请求使用的ANSI_DEFAULTS标志。 28. ansi_warnings:请求使用的ANSI_WARNINGS标志。 29. ansi_padding:请求使用的ANSI_PADDING标志。 30. ansi_nulls:请求使用的ANSI_NULLS标志。 31. concat_null_yields_null:请求使用的CONCAT_NULL_YIELDS_NULL标志。 32. transaction_isolation_level:请求使用的事务隔离级别。 33. lock_timeout:请求使用的锁超时时间。 34. deadlock_priority:请求使用的死锁优先级。 35. row_count:请求所影响的行数。 36. prev_error:请求上一个错误的状态。 注释:以上信息来自于Microsoft SQL Server官网,仅供参考。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值