zoukankan
html css js c++ java
SQL Server 调优将会用到的非常好的DMV
Code
1
SELECT
creation_time N
'
语句编译时间
'
2
,last_execution_time N
'
上次执行时间
'
3
,total_physical_reads N
'
物理读取总次数
'
4
,total_logical_reads
/
execution_count N
'
每次逻辑读次数
'
5
,total_logical_reads N
'
逻辑读取总次数
'
6
,total_logical_writes N
'
逻辑写入总次数
'
7
, execution_count N
'
执行次数
'
8
, total_worker_time
/
1000
N
'
所用的CPU总时间ms
'
9
, total_elapsed_time
/
1000
N
'
总花费时间ms
'
10
, (total_elapsed_time
/
execution_count)
/
1000
N
'
平均时间ms
'
11
,
SUBSTRING
(st.
text
, (qs.statement_start_offset
/
2
)
+
1
,
12
((
CASE
statement_end_offset
13
WHEN
-
1
THEN
DATALENGTH
(st.
text
)
14
ELSE
qs.statement_end_offset
END
15
-
qs.statement_start_offset)
/
2
)
+
1
) N
'
执行语句
'
16
FROM
sys.dm_exec_query_stats
AS
qs
17
CROSS
APPLY sys.dm_exec_sql_text(qs.sql_handle) st
18
where
SUBSTRING
(st.
text
, (qs.statement_start_offset
/
2
)
+
1
,
19
((
CASE
statement_end_offset
20
WHEN
-
1
THEN
DATALENGTH
(st.
text
)
21
ELSE
qs.statement_end_offset
END
22
-
qs.statement_start_offset)
/
2
)
+
1
)
not
like
'
%fetch%
'
23
ORDER
BY
total_elapsed_time
/
execution_count
DESC
;
24
查看全文
相关阅读:
迭代器生成器
elasticsearch系列(五)score
数据结构(五)串
数据结构系列(四)栈与队列
数据结构系列(三)线性表
数据结构系列(二)算法
数据结构系列(一)入门
elasticsearch系列(四)部署
SpringBoot系列(一)RestTemplate
基于python的爬虫(一)
原文地址:https://www.cnblogs.com/killkill/p/1304831.html
最新文章
Appium自动化测试框架
使用Xpath定位元素
解除服务器端口号占用及服务器端口号的修改
决策树算法(ID3)
python单例模式
python 乘法表、打印菱形
Qt中文本编辑器实现语法高亮功能(Qscitinlla)
Linux下使用thrfit
windows下thrift的使用(C++)
windows下thrift的使用(python)
热门文章
利用python制作电子签名
#pragma region、{}
python定时器
面向对象的日常笔记
自定义threading.local
Python并发编程
python网络编程
面向对象进阶
python中类方法,实例方法,静态方法的作用和区别
面向对象基础
Copyright © 2011-2022 走看看