Update from Sync Service
This commit is contained in:
15
附件/2026/个人知识库/数据库/Cpu 占用过高.md
Executable file
15
附件/2026/个人知识库/数据库/Cpu 占用过高.md
Executable file
@@ -0,0 +1,15 @@
|
||||
```sql
|
||||
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)) * 2
|
||||
ELSE statement_end_offset
|
||||
```sql
|
||||
END - statement_start_offset)/2)
|
||||
FROM sys.dm_exec_sql_text(sql_handle)) AS query_text
|
||||
FROM sys.dm_exec_query_stats
|
||||
```
|
||||
ORDER BY [avg_cpu_cost] DESC
|
||||
Reference in New Issue
Block a user