SQL Server Diagnosis Tools
seawalt
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
get the top-10 queries that are taking the most CPU
<br />SELECT TOP 10<br /> total_worker_time/execution_count AS avg_cpu_cost, plan_handle,<br /> execution_count,<br /> (SELECT SUBSTRING(text, statement_start_offset/2 + 1,<br /> (CASE WHEN statement_end_offset = -1<br /> THEN LEN(CONVER转载 2010-06-25 17:07:00 · 277 阅读 · 0 评论 -
get the top-10 queries that are taking the most CPU per execution
1.SELECT TOP 10 total_worker_time/execution_count AS avg_cpu_cost, plan_handle, execution_count, (SELECT SUBSTRING(text, statement_start_offset/2 + 1, (CASE WHEN statement_end_offset = -1 THEN LEN(CONVERT(nvarchar(max), text))原创 2010-06-09 15:34:00 · 353 阅读 · 0 评论 -
find the top-10 query plans that have been recompiled the most.
SELECT TOP 10 plan_generation_num, execution_count, (SELECT SUBSTRING(text, statement_start_offset/2 + 1, (CASE WHEN statement_end_offset = -1 THEN LEN(CONVERT(nvarchar(max),text)) * 2 ELSE statement_end_offset END - s原创 2010-06-09 15:37:00 · 290 阅读 · 0 评论 -
find the total amount of memory consumed (including AWE) by the buffer pool
SELECT SUM(multi_pages_kb + virtual_memory_committed_kb + shared_memory_committed_kb + awe_allocated_kb) AS [Used by BPool, Kb]FROM sys.dm_os_memory_clerksWHERE type = 'MEMORYCLERK_SQLBUFFERPOOL'原创 2010-06-09 15:41:00 · 381 阅读 · 0 评论 -
provide the I/O performance information at the database file leve
SELECT DBS.database_id, DBS.name, file_id, io_stall_read_ms, io_stall_write_msFROM sys.dm_io_virtual_file_stats(NULL, NULL) IO_FilesJOIN SYS.DATABASES DBSON IO_FILES.database_id=dbs.database_id转载 2010-06-09 16:31:00 · 339 阅读 · 0 评论 -
find the top-10 queries that do the most I/Os per execution
SELECT TOP 10 (total_logical_reads/execution_count) AS avg_logical_reads, (total_logical_writes/execution_count) AS avg_logical_writes, (total_physical_reads/execution_count) AS avg_phys_reads, execution_count, (SELECT SUBSTRING(text, statement_s原创 2010-06-09 16:35:00 · 370 阅读 · 0 评论 -
Find out the missing indexes and their usefulness
SELECT t1.object_id, t2.user_seeks, t2.user_scans, t1.equality_columns, t1.inequality_columnsFROM sys.dm_db_missing_index_details AS t1, sys.dm_db_missing_index_group_stats AS t2, sys.dm_db_missing_index_groups AS t3WHERE database_id = DB_ID() AND原创 2010-06-09 16:44:00 · 262 阅读 · 0 评论 -
Figure out which databases involve most of the I/O
WITH Waits AS( SELECT wait_type, wait_time_ms / 1000. AS wait_time_s, 100. * wait_time_ms / SUM(wait_time_ms) OVER() AS pct, ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS rn FROM sys.dm_os_wait_stats WHERE wait_type NOT LI转载 2010-06-25 17:10:00 · 295 阅读 · 0 评论
分享