Top Queries by Average CPU Time
SELECT TOP(10) creation_time , last_execution_time , (total_worker_time+0.0)/1000 AS total_worker_time , (total_worker_time+0.0)/(execution_count*1000) AS [AvgCPUTime] , execution_count , st.text FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(sql_handle) st WHERE total_worker_time > 0 ORDER BY total_worker_time DESC |
Top Queries by Average IO Time
SELECT TOP 10 creation_time , last_execution_time , total_logical_reads AS [LogicalReads] , total_logical_writes AS [LogicalWrites] , execution_count , total_logical_reads+total_logical_writes AS [AggIO] , (total_logical_reads+total_logical_writes)/(execution_count+0.0) AS [AvgIO] , st.TEXT , DB_NAME(st.dbid) AS database_name , st.objectid AS OBJECT_ID FROM sys.dm_exec_query_stats qs CROSS APPLY sys.dm_exec_sql_text(sql_handle) st WHERE total_logical_reads+total_logical_writes > 0 AND sql_handle IS NOT NULL ORDER BY [AggIO] DESC |
https://blog.sqlauthority.com/2014/07/29/sql-server-ssms-top-queries-by-cpu-and-io/
'SQL > DBA 가이드' 카테고리의 다른 글
Azure Column store demo (0) | 2018.08.30 |
---|---|
모든 데이터베이스 전체 공간 및 여유 공간 조회 (0) | 2017.02.01 |
SQL Server 2005 에서 2012 로 업그레이드 시 오류 (0) | 2014.08.07 |
MSSQL DBA (0) | 2014.07.21 |
[MSSQL] 2005 이상 LOCK MONITORING (0) | 2013.05.21 |