Skip to content

Commit c774ea3

Browse files
CopilotBrentOzar
andauthored
Lower In-Memory OLTP priorities when only tempdb uses XTP memory
Agent-Logs-Url: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/sessions/d69bc901-46c3-4bf7-bc4b-b297911de63c Co-authored-by: BrentOzar <245462+BrentOzar@users.noreply.github.com>
1 parent 35673cd commit c774ea3

3 files changed

Lines changed: 84 additions & 0 deletions

File tree

Install-All-Scripts.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41396,6 +41396,34 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
4139641396
AND ps.counter_name = 'Transactions aborted/sec'
4139741397
AND ps.value_delta > (10 * @Seconds); /* Ignore servers sitting idle */
4139841398

41399+
IF EXISTS
41400+
(
41401+
SELECT 1/0
41402+
FROM #PerfmonStats AS ps
41403+
WHERE ps.Pass = 2
41404+
AND ps.object_name = @ServiceName + ':Databases'
41405+
AND ps.counter_name = 'XTP Memory Used (KB)'
41406+
AND ps.instance_name = 'tempdb'
41407+
AND ps.cntr_value > 0
41408+
)
41409+
AND NOT EXISTS
41410+
(
41411+
SELECT 1/0
41412+
FROM #PerfmonStats AS ps
41413+
WHERE ps.Pass = 2
41414+
AND ps.object_name = @ServiceName + ':Databases'
41415+
AND ps.counter_name = 'XTP Memory Used (KB)'
41416+
AND ps.instance_name NOT IN ('tempdb', '_Total')
41417+
AND ps.cntr_value > 0
41418+
)
41419+
BEGIN
41420+
UPDATE bfr
41421+
SET bfr.Priority = 210
41422+
FROM #BlitzFirstResults AS bfr
41423+
WHERE bfr.FindingsGroup = 'In-Memory OLTP'
41424+
AND bfr.Priority < 210;
41425+
END;
41426+
4139941427
/* Query Problems - Suboptimal Plans/Sec High - CheckID 33 */
4140041428
IF (@Debug = 1)
4140141429
BEGIN

Install-Azure.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25843,6 +25843,34 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
2584325843
AND ps.counter_name = 'Transactions aborted/sec'
2584425844
AND ps.value_delta > (10 * @Seconds); /* Ignore servers sitting idle */
2584525845

25846+
IF EXISTS
25847+
(
25848+
SELECT 1/0
25849+
FROM #PerfmonStats AS ps
25850+
WHERE ps.Pass = 2
25851+
AND ps.object_name = @ServiceName + ':Databases'
25852+
AND ps.counter_name = 'XTP Memory Used (KB)'
25853+
AND ps.instance_name = 'tempdb'
25854+
AND ps.cntr_value > 0
25855+
)
25856+
AND NOT EXISTS
25857+
(
25858+
SELECT 1/0
25859+
FROM #PerfmonStats AS ps
25860+
WHERE ps.Pass = 2
25861+
AND ps.object_name = @ServiceName + ':Databases'
25862+
AND ps.counter_name = 'XTP Memory Used (KB)'
25863+
AND ps.instance_name NOT IN ('tempdb', '_Total')
25864+
AND ps.cntr_value > 0
25865+
)
25866+
BEGIN
25867+
UPDATE bfr
25868+
SET bfr.Priority = 210
25869+
FROM #BlitzFirstResults AS bfr
25870+
WHERE bfr.FindingsGroup = 'In-Memory OLTP'
25871+
AND bfr.Priority < 210;
25872+
END;
25873+
2584625874
/* Query Problems - Suboptimal Plans/Sec High - CheckID 33 */
2584725875
IF (@Debug = 1)
2584825876
BEGIN

sp_BlitzFirst.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,6 +3526,34 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
35263526
AND ps.counter_name = 'Transactions aborted/sec'
35273527
AND ps.value_delta > (10 * @Seconds); /* Ignore servers sitting idle */
35283528

3529+
IF EXISTS
3530+
(
3531+
SELECT 1/0
3532+
FROM #PerfmonStats AS ps
3533+
WHERE ps.Pass = 2
3534+
AND ps.object_name = @ServiceName + ':Databases'
3535+
AND ps.counter_name = 'XTP Memory Used (KB)'
3536+
AND ps.instance_name = 'tempdb'
3537+
AND ps.cntr_value > 0
3538+
)
3539+
AND NOT EXISTS
3540+
(
3541+
SELECT 1/0
3542+
FROM #PerfmonStats AS ps
3543+
WHERE ps.Pass = 2
3544+
AND ps.object_name = @ServiceName + ':Databases'
3545+
AND ps.counter_name = 'XTP Memory Used (KB)'
3546+
AND ps.instance_name NOT IN ('tempdb', '_Total')
3547+
AND ps.cntr_value > 0
3548+
)
3549+
BEGIN
3550+
UPDATE bfr
3551+
SET bfr.Priority = 210
3552+
FROM #BlitzFirstResults AS bfr
3553+
WHERE bfr.FindingsGroup = 'In-Memory OLTP'
3554+
AND bfr.Priority < 210;
3555+
END;
3556+
35293557
/* Query Problems - Suboptimal Plans/Sec High - CheckID 33 */
35303558
IF (@Debug = 1)
35313559
BEGIN

0 commit comments

Comments
 (0)