Commit 1dda695
sp_BlitzIndex: apply @ThresholdMB consistently across @mode = 0 and 4
Fixes BrentOzarULTD#3934
The @ThresholdMB parameter was honored by only a handful of checks. Every
check that already joins #IndexSanitySize now applies the standard pattern:
AND sz.total_reserved_MB >= CASE WHEN (@GetAllDatabases = 1 OR @mode = 0)
THEN @ThresholdMB ELSE sz.total_reserved_MB END
Checks updated (added threshold filter):
@mode = 0: 2, 11, 20, 34, 40 (NC), 40 (CX), 47, 68, 72, 124, 128
@mode = 4: 21, 23, 24, 25, 26, 27, 28, 33, 60, 61, 62, 63, 64, 65, 66,
67, 69, 70, 73, 74, 80, 81, 129
Checks fixed (replaced inverse gating with the standard pattern):
43 (Heaps with forwarded records)
49 (Heaps with deletes)
Checks intentionally left alone:
44, 45, 46 - hardcoded size bands are the purpose of those checks
50 - uses #MissingIndexes with a LEFT JOIN to an aggregated CTE;
needs its own treatment
122, 123 - resumable operations have no meaningful size context yet
90, 91, 92, 94, 99, 125 - statistics and constraint checks have no
per-index MB to gate on
30, 31, 32, 41, 42, 71, 72 (FK), 74 (identity seed) - no size context
(where 74 already joined #IndexSanitySize, it is updated)
For check 61 (columnstore) and 63 (compressed), the existing WHERE used an
unparenthesised OR; parentheses were added so the new AND binds against the
whole predicate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9742259 commit 1dda695
1 file changed
Lines changed: 58 additions & 22 deletions
0 commit comments