会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
zping
MySQL,SQL SERVER等研究,优化及中华优秀文化
博客园
首页
新随笔
联系
订阅
管理
sql server性能分析--执行计划重用次数
分析sql
执行计划重用次数
,查看绑定变量使用情况
select
total_elapsed_time
/
execution_count 平均时间,total_logical_reads
/
execution_count 逻辑读,
usecounts 重用次数,
SUBSTRING
(d.
text
, (statement_start_offset
/
2
)
+
1
,
((
CASE
statement_end_offset
WHEN
-
1
THEN
DATALENGTH
(
text
)
ELSE
statement_end_offset
END
-
statement_start_offset)
/
2
)
+
1
) 语句执行
from
sys.dm_exec_cached_plans a
cross
apply sys.dm_exec_query_plan(a.plan_handle) c
,sys.dm_exec_query_stats b
cross
apply sys.dm_exec_sql_text(b.sql_handle) d
where
a.plan_handle
=
b.plan_handle
and
total_logical_reads
/
execution_count
>
4000
ORDER
BY
total_elapsed_time
/
execution_count
DESC
;
posted @
2008-07-15 13:46
zping
阅读(
1589
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告