Skip to content

Commit 13c2e21

Browse files
Merge pull request #694 from erikdarlingdata/feature/healthparser-maxdop1-select-into
sp_HealthParser: add MAXDOP 1 to SELECT INTO queries
2 parents dc7b1ad + 7b1b90b commit 13c2e21

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

sp_HealthParser/sp_HealthParser.sql

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ AND ca.utc_timestamp < @end_date';
19541954
FROM #ignore_waits AS i
19551955
WHERE w.x.exist('(data[@name="wait_type"]/text/text())[1][.= sql:column("i.wait_type")]') = 1
19561956
)
1957-
OPTION(RECOMPILE);
1957+
OPTION(RECOMPILE, MAXDOP 1);
19581958

19591959
IF @debug = 1
19601960
BEGIN
@@ -2187,7 +2187,7 @@ AND ca.utc_timestamp < @end_date';
21872187
FROM #ignore_waits AS i
21882188
WHERE w2.x2.exist('@waitType[.= sql:column("i.wait_type")]') = 1
21892189
)
2190-
OPTION(RECOMPILE);
2190+
OPTION(RECOMPILE, MAXDOP 1);
21912191

21922192
IF @debug = 1
21932193
BEGIN
@@ -2234,7 +2234,7 @@ AND ca.utc_timestamp < @end_date';
22342234
@wait_round_interval_minutes,
22352235
'19000101'
22362236
)
2237-
OPTION(RECOMPILE);
2237+
OPTION(RECOMPILE, MAXDOP 1);
22382238

22392239
/* Waits by count logging section */
22402240
IF NOT EXISTS
@@ -2444,7 +2444,7 @@ AND ca.utc_timestamp < @end_date';
24442444
FROM #ignore_waits AS i
24452445
WHERE w2.x2.exist('@waitType[.= sql:column("i.wait_type")]') = 1
24462446
)
2447-
OPTION(RECOMPILE);
2447+
OPTION(RECOMPILE, MAXDOP 1);
24482448

24492449
IF @debug = 1
24502450
BEGIN
@@ -2494,7 +2494,7 @@ AND ca.utc_timestamp < @end_date';
24942494
td.waits,
24952495
td.average_wait_time_ms,
24962496
td.max_wait_time_ms
2497-
OPTION(RECOMPILE);
2497+
OPTION(RECOMPILE, MAXDOP 1);
24982498

24992499
/* Waits by duration logging section */
25002500
IF NOT EXISTS
@@ -2730,7 +2730,7 @@ AND ca.utc_timestamp < @end_date';
27302730
OUTER APPLY w.x.nodes('/event/data/value/ioSubsystem/longestPendingRequests/pendingRequest') AS w2(x2)
27312731
WHERE w.x.exist('(data[@name="component"]/text[.= "IO_SUBSYSTEM"])') = 1
27322732
AND (w.x.exist('(data[@name="state"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
2733-
OPTION(RECOMPILE);
2733+
OPTION(RECOMPILE, MAXDOP 1);
27342734

27352735
IF @debug = 1
27362736
BEGIN
@@ -2763,7 +2763,7 @@ AND ca.utc_timestamp < @end_date';
27632763
i.intervalLongIos,
27642764
i.totalLongIos,
27652765
ISNULL(i.longestPendingRequests_filePath, 'N/A')
2766-
OPTION(RECOMPILE);
2766+
OPTION(RECOMPILE, MAXDOP 1);
27672767

27682768
/* Potential IO issues logging section */
27692769
IF NOT EXISTS
@@ -2950,7 +2950,7 @@ AND ca.utc_timestamp < @end_date';
29502950
WHERE w.x.exist('(data[@name="component"]/text[.= "QUERY_PROCESSING"])') = 1
29512951
AND (w.x.exist('(data[@name="state"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
29522952
AND (w.x.exist('(/event/data[@name="data"]/value/queryProcessing/@pendingTasks[.>= sql:variable("@pending_task_threshold")])') = 1 OR @warnings_only = 0)
2953-
OPTION(RECOMPILE);
2953+
OPTION(RECOMPILE, MAXDOP 1);
29542954

29552955
IF @debug = 1
29562956
BEGIN
@@ -3177,7 +3177,7 @@ AND ca.utc_timestamp < @end_date';
31773177
CROSS APPLY w.x.nodes('/event/data[@name="data"]/value/queryProcessing[@pendingTasks > 1]/pendingTasks/entryPoint') AS ep(e)
31783178
WHERE w.x.exist('(data[@name="component"]/text[.= "QUERY_PROCESSING"])') = 1
31793179
AND (w.x.exist('(data[@name="state"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
3180-
OPTION(RECOMPILE);
3180+
OPTION(RECOMPILE, MAXDOP 1);
31813181

31823182
IF @debug = 1
31833183
BEGIN
@@ -3386,7 +3386,7 @@ AND ca.utc_timestamp < @end_date';
33863386
FROM #sp_server_diagnostics_component_result AS s
33873387
CROSS APPLY s.sp_server_diagnostics_component_result.nodes('/event/data/value/resource') AS r(c)
33883388
WHERE (r.c.exist('@lastNotification[.= "RESOURCE_MEMPHYSICAL_LOW"]') = @warnings_only OR @warnings_only = 0)
3389-
OPTION(RECOMPILE);
3389+
OPTION(RECOMPILE, MAXDOP 1);
33903390

33913391
IF @debug = 1
33923392
BEGIN
@@ -3617,7 +3617,7 @@ AND ca.utc_timestamp < @end_date';
36173617
FROM #memory_broker AS mb
36183618
CROSS APPLY mb.memory_broker.nodes('//event') AS w(x)
36193619
WHERE (w.x.exist('(data[@name="notification"]/value[.= "RESOURCE_MEMPHYSICAL_LOW"])') = @warnings_only OR @warnings_only = 0)
3620-
OPTION(RECOMPILE);
3620+
OPTION(RECOMPILE, MAXDOP 1);
36213621

36223622
IF @debug = 1
36233623
BEGIN
@@ -3911,7 +3911,7 @@ AND ca.utc_timestamp < @end_date';
39113911
INTO #memory_node_oom_info
39123912
FROM #memory_node_oom AS mno
39133913
CROSS APPLY mno.memory_node_oom.nodes('//event') AS w(x)
3914-
OPTION(RECOMPILE);
3914+
OPTION(RECOMPILE, MAXDOP 1);
39153915

39163916
IF @debug = 1
39173917
BEGIN
@@ -4311,7 +4311,7 @@ AND ca.utc_timestamp < @end_date';
43114311
CROSS APPLY wi.sp_server_diagnostics_component_result.nodes('//event') AS w(x)
43124312
WHERE w.x.exist('(data[@name="component"]/text[.= "SYSTEM"])') = 1
43134313
AND (w.x.exist('(data[@name="state"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
4314-
OPTION(RECOMPILE);
4314+
OPTION(RECOMPILE, MAXDOP 1);
43154315

43164316
IF @debug = 1
43174317
BEGIN
@@ -4506,7 +4506,7 @@ AND ca.utc_timestamp < @end_date';
45064506
FROM #scheduler_monitor AS sm
45074507
CROSS APPLY sm.scheduler_monitor.nodes('//event') AS w(x)
45084508
WHERE (w.x.exist('(data[@name="status"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
4509-
OPTION(RECOMPILE);
4509+
OPTION(RECOMPILE, MAXDOP 1);
45104510

45114511
IF @debug = 1
45124512
BEGIN
@@ -4733,7 +4733,7 @@ AND ca.utc_timestamp < @end_date';
47334733
FROM #ignore_errors AS ie
47344734
WHERE w.x.value('(data[@name="error_number"]/value)[1]', 'integer') = ie.error_number
47354735
)
4736-
OPTION(RECOMPILE);
4736+
OPTION(RECOMPILE, MAXDOP 1);
47374737

47384738
IF @debug = 1
47394739
BEGIN
@@ -4940,7 +4940,7 @@ AND ca.utc_timestamp < @end_date';
49404940
WHERE w.x.exist('(data[@name="component"]/text[.= "QUERY_PROCESSING"])') = 1
49414941
AND w.x.exist('//data[@name="data"]/value/queryProcessing/cpuIntensiveRequests/request') = 1
49424942
AND (w.x.exist('(data[@name="state"]/text[.= "WARNING"])') = @warnings_only OR @warnings_only = 0)
4943-
OPTION(RECOMPILE);
4943+
OPTION(RECOMPILE, MAXDOP 1);
49444944
49454945
IF @debug = 1
49464946
BEGIN
@@ -5070,7 +5070,7 @@ AND ca.utc_timestamp < @end_date';
50705070
OUTER APPLY oa.c.nodes('//blocked-process-report/blocked-process') AS bd(bd)
50715071
WHERE bd.exist('process/@spid') = 1
50725072
AND (bd.exist('process[@currentdbname = sql:variable("@database_name")]') = 1 OR @database_name IS NULL)
5073-
OPTION(RECOMPILE);
5073+
OPTION(RECOMPILE, MAXDOP 1);
50745074

50755075
IF @debug = 1
50765076
BEGIN
@@ -5147,7 +5147,7 @@ AND ca.utc_timestamp < @end_date';
51475147
OUTER APPLY oa.c.nodes('//blocked-process-report/blocking-process') AS bg(bg)
51485148
WHERE bg.exist('process/@spid') = 1
51495149
AND (bg.exist('process[@currentdbname = sql:variable("@database_name")]') = 1 OR @database_name IS NULL)
5150-
OPTION(RECOMPILE);
5150+
OPTION(RECOMPILE, MAXDOP 1);
51515151

51525152
IF @debug = 1
51535153
BEGIN
@@ -5331,7 +5331,7 @@ AND ca.utc_timestamp < @end_date';
53315331
WHERE (bd.currentdbname = @database_name
53325332
OR @database_name IS NULL)
53335333
) AS kheb
5334-
OPTION(RECOMPILE);
5334+
OPTION(RECOMPILE, MAXDOP 1);
53355335

53365336
IF @debug = 1
53375337
BEGIN
@@ -5575,7 +5575,7 @@ AND ca.utc_timestamp < @end_date';
55755575
WHERE (b.currentdbname = @database_name
55765576
OR @database_name IS NULL)
55775577
) AS b
5578-
OPTION(RECOMPILE);
5578+
OPTION(RECOMPILE, MAXDOP 1);
55795579

55805580
IF @debug = 1
55815581
BEGIN
@@ -5589,7 +5589,7 @@ AND ca.utc_timestamp < @end_date';
55895589
deadlock_graph = x.xml_deadlock_report.query('/event/data/value/deadlock')
55905590
INTO #deadlocks
55915591
FROM #xml_deadlock_report AS x
5592-
OPTION(RECOMPILE);
5592+
OPTION(RECOMPILE, MAXDOP 1);
55935593

55945594
IF @debug = 1
55955595
BEGIN
@@ -5723,7 +5723,7 @@ AND ca.utc_timestamp < @end_date';
57235723
OR @dbid IS NULL)
57245724
OR (x.current_database_name = @database_name
57255725
OR @database_name IS NULL)
5726-
OPTION(RECOMPILE);
5726+
OPTION(RECOMPILE, MAXDOP 1);
57275727

57285728
IF @debug = 1
57295729
BEGIN
@@ -6166,7 +6166,7 @@ AND ca.utc_timestamp < @end_date';
61666166
WHERE ap.query_plan IS NOT NULL
61676167
ORDER BY
61686168
ap.avg_worker_time_ms DESC
6169-
OPTION(RECOMPILE);
6169+
OPTION(RECOMPILE, MAXDOP 1);
61706170

61716171
IF EXISTS
61726172
(

0 commit comments

Comments
 (0)