Skip to content

Commit 4a11dbc

Browse files
authored
Merge pull request #3638 from BrentOzarULTD/3637_sp_BlitzFirst_deadlock_warning
#3637 sp_BlitzFirst deadlock warning
2 parents 363322a + 126a608 commit 4a11dbc

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

Diff for: Documentation/sp_BlitzFirst_Checks_by_Priority.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav
66

77
If you want to change anything about a check - the priority, finding, URL, or ID - open a Github issue first. The relevant scripts have to be updated too.
88

9-
CURRENT HIGH CHECKID: 50
10-
If you want to add a new check, start at 51.
9+
CURRENT HIGH CHECKID: 51
10+
If you want to add a new check, start at 52.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
|----------|---------------------------------|---------------------------------------|-------------------------------------------------|----------|
@@ -42,10 +42,11 @@ If you want to add a new check, start at 51.
4242
| 50 | Server Performance | Too Much Free Memory | https://www.brentozar.com/go/freememory | 34 |
4343
| 50 | Server Performance | Memory Grants pending | https://www.brentozar.com/blitz/memory-grants | 39 |
4444
| 100 | In-Memory OLTP | Transactions aborted | https://www.brentozar.com/go/aborted | 32 |
45-
| 100 | Query Problems | Suboptimal Plans/Sec High | https://www.brentozar.com/go/suboptimal | 33 |
4645
| 100 | Query Problems | Bad Estimates | https://www.brentozar.com/go/skewedup | 42 |
47-
| 100 | Query Problems | Skewed Parallelism | https://www.brentozar.com/go/skewedup | 43 |
46+
| 100 | Query Problems | Deadlocks | https://www.brentozar.com/go/deadlocks | 51 |
4847
| 100 | Query Problems | Query with a memory grant exceeding @MemoryGrantThresholdPct | https://www.brentozar.com/memory-grants-sql-servers-public-toilet/ | 46 |
48+
| 100 | Query Problems | Skewed Parallelism | https://www.brentozar.com/go/skewedup | 43 |
49+
| 100 | Query Problems | Suboptimal Plans/Sec High | https://www.brentozar.com/go/suboptimal | 33 |
4950
| 200 | Wait Stats | (One per wait type) | https://www.brentozar.com/sql/wait-stats/#(waittype) | 6 |
5051
| 210 | Potential Upcoming Problems | High Number of Connections |https://www.brentozar.com/archive/2014/05/connections-slow-sql-server-threadpool/ | 49 |
5152
| 210 | Query Stats | Plan Cache Analysis Skipped | https://www.brentozar.com/go/topqueries | 18 |

Diff for: sp_BlitzFirst.sql

+22
Original file line numberDiff line numberDiff line change
@@ -3081,6 +3081,28 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
30813081
END;
30823082

30833083

3084+
/* Query Problems - Deadlocks - CheckID 51 */
3085+
IF (@Debug = 1)
3086+
BEGIN
3087+
RAISERROR('Running CheckID 51',10,1) WITH NOWAIT;
3088+
END
3089+
3090+
INSERT INTO #BlitzFirstResults (CheckID, Priority, FindingsGroup, Finding, URL, Details, HowToStopIt)
3091+
SELECT 51 AS CheckID,
3092+
100 AS Priority,
3093+
'Query Problems' AS FindingGroup,
3094+
'Deadlocks' AS Finding,
3095+
' https://www.brentozar.com/go/deadlocks' AS URL,
3096+
'Number of deadlocks during the sample: ' + CAST(ps.value_delta AS NVARCHAR(20)) + @LineFeed
3097+
+ 'Determined by sampling Perfmon counter ' + ps.object_name + ' - ' + ps.counter_name + @LineFeed AS Details,
3098+
'Check sp_BlitzLock to find which indexes and queries to tune.' AS HowToStopIt
3099+
FROM #PerfmonStats ps
3100+
WHERE ps.Pass = 2
3101+
AND counter_name = 'Number of Deadlocks/sec'
3102+
AND instance_name LIKE '_Total%'
3103+
AND value_delta > 0;
3104+
3105+
30843106
/* SQL Server Internal Maintenance - Log File Growing - CheckID 13 */
30853107
IF (@Debug = 1)
30863108
BEGIN

0 commit comments

Comments
 (0)