当前位置:网站首页>SQL server performance analysis, view slow queries
SQL server performance analysis, view slow queries
2022-07-23 12:47:00 【Monster in the North Sea】
-- This is to view the execution process analysis of a statement
set showplan_all on
select * from iexec.local_quality_web.commonality_queue where Analysis_Type = 'PTAM' and Part_Num like '%NYJA0088%'
use master -- Switch database Then execute the following statement , You can see which statements execute slowly
SELECT TOP 20
total_worker_time/1000 AS [ Total consumption CPU Time (ms)],execution_count [ Number of runs ],
qs.total_worker_time/qs.execution_count/1000 AS [ Average consumption CPU Time (ms)],
last_execution_time AS [ Last execution time ],max_worker_time /1000 AS [ Maximum execution time (ms)],
SUBSTRING(qt.text,qs.statement_start_offset/2+1,
(CASE WHEN qs.statement_end_offset = -1
THEN DATALENGTH(qt.text)
ELSE qs.statement_end_offset END -qs.statement_start_offset)/2 + 1)
AS [ Use CPU The grammar of ], qt.text [ Complete grammar ],
dbname=db_name(qt.dbid),
object_name(qt.objectid,qt.dbid) ObjectName
FROM sys.dm_exec_query_stats qs WITH(nolock)
CROSS apply sys.dm_exec_sql_text(qs.sql_handle) AS qt
WHERE execution_count>1
ORDER BY total_worker_time DESC
边栏推荐
猜你喜欢

OSPF和RIP的路由扩展配置

Common sort -- merge sort (recursive and non recursive) + count sort

socket基础知识以及各种使用场景

Unity3d+GameFramework:资源分析,资源依赖,循环依赖检测

HCIP---MGRE环境下的OSPF综合实验

unity3d:Assetbundle模拟加载,同步加载,异步加载,依赖包加载,自动标签,AB浏览器,增量打包

C# 自定义栈(Stack)

Summary of video coding and decoding related data

Unity3d:UGUI,UI与特效粒子层级,2018.2以上版本BakeMesh,粒子在两个Image之间且在ScrollView

HCIP---BGP相关配置(联邦篇)
随机推荐
剑指 Offer做题总结
[AUTOSAR storage stack NVM]
Analyze redis server
剑指offer 青蛙跳楼梯
Unity在URP管线下使用TriLib插件加载模型材质不正确的问题
主机字节序的判定
APISIX的源码安装与使用
Implementation of binary tree -c
LVS负载均衡调度原理及配置方法
0动态规划 LeetCode918. 环形子数组的最大和
SQL基础操作总结
In depth analysis of replication in redis
Prometheus
Basic knowledge of high voltage technology
理解不能的锁们
Explain the interactive data flow and block data flow of TCP in detail
HCIP---OSPF细节讲解
详解TCP连接的释放
HCIP---HCIA知识回顾(一)
Unity shader missing problem