sql server性能分析--执行sql次数和逻辑次数

dbcc freeProcCache

SELECT   creation_time   N'语句编译时间'
b9d359da26a8e990b6fd48a2.jpg         ,last_execution_time   N'上次执行时间'
e5dc31db1f9e822dd0164ea2.jpg         ,total_physical_reads N'物理读取总次数'
d2ea5a667b75d96fab184ca2.jpg         ,total_logical_reads/execution_count N'每次逻辑读次数'
b4010124067b4760d40742a2.jpg         ,total_logical_reads   N'逻辑读取总次数'
cf0f9f2b7b64e5b1e6cd40a2.jpg         ,total_logical_writes N'逻辑写入总次数'
b0103dfa57aeabc29e5146a2.jpg         , execution_count   N'执行次数'
82da73892d32dff80f2444a2.jpg         , total_worker_time/1000 N'所用的CPU总时间ms'
fa4607b3ba4792ecd9335aa2.jpg         , total_elapsed_time/1000   N'总花费时间ms'
6b334aa76e5018ded14358a2.jpg         , (total_elapsed_time / execution_count)/1000   N'平均时间ms'
bd24c09568207d00d1135ea2.jpg         ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
b554a54b6a70a3bb82025ca2.jpg          ((CASE statement_end_offset 
b5047bf03f618ae4a40f52a2.jpg          WHEN -1 THEN DATALENGTH(st.text)
e61552af1b6c9bb0fbed50a2.jpg          ELSE qs.statement_end_offset END 
c01843fb3a8e7b2f034f56a2.jpg            - qs.statement_start_offset)/2) + 1) N'执行语句'
9ffaa364c02ca8bbf73654a2.jpgFROM sys.dm_exec_query_stats AS qs
675870f032557f887931aaa3.jpgCROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
9321a7c3be52da1eb319a8a3.jpgwhere SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
1d2602557a7a3b8fb745aea3.jpg          ((CASE statement_end_offset 
d70ee3c47c2693e28226aca3.jpg          WHEN -1 THEN DATALENGTH(st.text)
d3524ba94f451fb71e17a2a3.jpg          ELSE qs.statement_end_offset END 
e631c7fcd1745ac9b901a0a3.jpg            - qs.statement_start_offset)/2) + 1) not like '%fetch%'
7a00828268629adbf603a6a3.jpgORDER BY   total_elapsed_time / execution_count DESC;


你可能感兴趣的:(数据库,server,服务器)