You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/sp_Blitz_Checks_by_Priority.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav
6
6
7
7
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.
SET @dsql=N'SELECT @ResumableIndexesDisappearAfter = CAST(value AS INT)
2618
+
FROM '+QUOTENAME(@DatabaseName) + N'.sys.database_scoped_configurations
2619
+
WHERE name = ''PAUSED_RESUMABLE_INDEX_ABORT_DURATION_MINUTES''
2620
+
AND value > 0;'
2621
+
EXEC sp_executesql @dsql, N'@ResumableIndexesDisappearAfter INT OUT', @ResumableIndexesDisappearAfter out;
2622
+
2623
+
IF @ResumableIndexesDisappearAfter ISNULL
2624
+
SET @ResumableIndexesDisappearAfter =0;
2625
+
2626
+
ENDTRY
2616
2627
BEGINCATCH
2617
2628
RAISERROR (N'Skipping #IndexResumableOperations population due to error, typically low permissions', 0,1) WITHNOWAIT;
2618
2629
ENDCATCH
@@ -3294,29 +3305,34 @@ BEGIN
3294
3305
SELECT
3295
3306
N'Resumable Index Operation'AS finding,
3296
3307
N'This may invalidate your analysis!'AS warning,
3297
-
iro.state_desc+' on '+iro.db_schema_table_index+
3308
+
iro.state_desc+N' on '+iro.db_schema_table_index+
3298
3309
CASEiro.state
3299
3310
WHEN0THEN
3300
-
' at MAXDOP '+CONVERT(NVARCHAR(30), iro.last_max_dop_used) +
3301
-
'. First started '+CONVERT(NVARCHAR(50), iro.start_time, 120) +'. '+
3302
-
CONVERT(NVARCHAR(6), CONVERT(MONEY, iro.percent_complete)) +'% complete after '+
3311
+
N' at MAXDOP '+CONVERT(NVARCHAR(30), iro.last_max_dop_used) +
3312
+
N'. First started '+CONVERT(NVARCHAR(50), iro.start_time, 120) +N'. '+
3313
+
CONVERT(NVARCHAR(6), CONVERT(MONEY, iro.percent_complete)) +N'% complete after '+
3303
3314
CONVERT(NVARCHAR(30), iro.total_execution_time) +
3304
-
' minute(s). This blocks DDL and can pile up ghosts.'
3315
+
N' minute(s). '+
3316
+
CASEWHEN @ResumableIndexesDisappearAfter >0
3317
+
THENN' Will be automatically removed by the database server at '+CONVERT(NVARCHAR(50), (DATEADD(mi, @ResumableIndexesDisappearAfter, iro.last_pause_time)), 121) +N'. '
3318
+
ELSEN' Will not be automatically removed by the database server. '
3319
+
END
3320
+
+N'This blocks DDL and can pile up ghosts.'
3305
3321
WHEN1THEN
3306
-
' since '+CONVERT(NVARCHAR(50), iro.last_pause_time, 120) +'. '+
At 100% completion, resumable indexes open up a transaction and go back to paused for what ought to be a moment.
3746
3762
Updating statistics is one of the things that it can do in this false paused state.
3747
3763
Updating stats can take a while, so we point it out as a likely delay.
3748
3764
It seems that any of the normal operations that happen at the very end of an index build can cause this.
3749
3765
*/
3750
3766
CASEWHENiro.percent_complete>99.9
3751
-
THEN'. It is probably still running, perhaps updating statistics.'
3752
-
ELSE' after '+CONVERT(NVARCHAR(30), iro.total_execution_time)
3753
-
+' minute(s). This blocks DDL, fails transactions needing table-level X locks, and can pile up ghosts.'
3767
+
THENN'. It is probably still running, perhaps updating statistics.'
3768
+
ELSEN' after '+CONVERT(NVARCHAR(30), iro.total_execution_time)
3769
+
+N' minute(s). This blocks DDL, fails transactions needing table-level X locks, and can pile up ghosts. '
3770
+
END+
3771
+
CASEWHEN @ResumableIndexesDisappearAfter >0
3772
+
THENN' Will be automatically removed by the database server at '+CONVERT(NVARCHAR(50), (DATEADD(mi, @ResumableIndexesDisappearAfter, iro.last_pause_time)), 121) +N'. '
3773
+
ELSEN' Will not be automatically removed by the database server. '
3754
3774
ENDAS details,
3755
-
'Old index: '+ISNULL(i.index_definition, 'not found. Either the index is new or you need @IncludeInactiveIndexes = 1') AS index_definition,
3775
+
N'Old index: '+ISNULL(i.index_definition, N'not found. Either the index is new or you need @IncludeInactiveIndexes = 1') AS index_definition,
3756
3776
i.secret_columns,
3757
3777
i.index_usage_summary,
3758
-
'New index: '+iro.reserved_MB_pretty_print+'; Old index: '+ISNULL(sz.index_size_summary,'not found.') AS index_size_summary,
3759
-
'New index: '+iro.sql_textAS create_tsql,
3778
+
N'New index: '+iro.reserved_MB_pretty_print+N'; Old index: '+ISNULL(sz.index_size_summary,'not found.') AS index_size_summary,
3779
+
N'New index: '+iro.sql_textAS create_tsql,
3760
3780
iro.more_info
3761
3781
FROM #IndexResumableOperations iro
3762
3782
LEFT JOIN #IndexSanity AS i ONi.database_id=iro.database_id
0 commit comments