Skip to content

Commit 13e2962

Browse files
authored
Merge pull request #2827 from BrentOzarULTD/2818_sp_Blitz_remove_38_and_39
#2818 sp_Blitz remove checks 38 and 39
2 parents 4ed2a6e + 41901aa commit 13e2962

File tree

2 files changed

+0
-65
lines changed

2 files changed

+0
-65
lines changed

Documentation/sp_Blitz_Checks_by_Priority.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ If you want to add a new one, start at 257.
110110
| 150 | Performance | Deadlocks Happening Daily | https://www.BrentOzar.com/go/deadlocks | 124 |
111111
| 150 | Performance | Forced Parameterization On | https://www.BrentOzar.com/go/forced | 18 |
112112
| 150 | Performance | Foreign Keys Not Trusted | https://www.BrentOzar.com/go/trust | 48 |
113-
| 150 | Performance | Inactive Tables Without Clustered Indexes | https://www.BrentOzar.com/go/heaps | 39 |
114113
| 150 | Performance | Leftover Fake Indexes From Wizards | https://www.BrentOzar.com/go/hypo | 46 |
115114
| 150 | Performance | Objects created with dangerous SET Options | https://www.BrentOzar.com/go/badset | 218 |
116115
| 150 | Performance | Queries Forcing Join Hints | https://www.BrentOzar.com/go/hints | 45 |

sp_Blitz.sql

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6383,38 +6383,6 @@ IF @ProductVersionMajor >= 10
63836383
HAVING SUM(1) > 0 OPTION (RECOMPILE)';
63846384
END;
63856385

6386-
IF NOT EXISTS ( SELECT 1
6387-
FROM #SkipChecks
6388-
WHERE DatabaseName IS NULL AND CheckID = 38 )
6389-
BEGIN
6390-
6391-
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 38) WITH NOWAIT;
6392-
6393-
EXEC dbo.sp_MSforeachdb 'USE [?];
6394-
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
6395-
INSERT INTO #BlitzResults
6396-
(CheckID,
6397-
DatabaseName,
6398-
Priority,
6399-
FindingsGroup,
6400-
Finding,
6401-
URL,
6402-
Details)
6403-
SELECT DISTINCT 38,
6404-
N''?'',
6405-
110,
6406-
''Performance'',
6407-
''Active Tables Without Clustered Indexes'',
6408-
''https://www.brentozar.com/go/heaps'',
6409-
(''The ['' + DB_NAME() + ''] database has heaps - tables without a clustered index - that are being actively queried.'')
6410-
FROM [?].sys.indexes i INNER JOIN [?].sys.objects o ON i.object_id = o.object_id
6411-
INNER JOIN [?].sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id
6412-
INNER JOIN sys.databases sd ON sd.name = N''?''
6413-
LEFT OUTER JOIN [?].sys.dm_db_index_usage_stats ius ON i.object_id = ius.object_id AND i.index_id = ius.index_id AND ius.database_id = sd.database_id
6414-
WHERE i.type_desc = ''HEAP'' AND COALESCE(NULLIF(ius.user_seeks,0), NULLIF(ius.user_scans,0), NULLIF(ius.user_lookups,0), NULLIF(ius.user_updates,0)) IS NOT NULL
6415-
AND sd.name <> ''tempdb'' AND sd.name <> ''DWDiagnostics'' AND o.is_ms_shipped = 0 AND o.type <> ''S'' OPTION (RECOMPILE)';
6416-
END;
6417-
64186386
IF NOT EXISTS ( SELECT 1
64196387
FROM #SkipChecks
64206388
WHERE DatabaseName IS NULL AND CheckID = 164 )
@@ -6443,38 +6411,6 @@ IF @ProductVersionMajor >= 10
64436411
FROM [?].sys.plan_guides g CROSS APPLY fn_validate_plan_guide(g.plan_guide_id) OPTION (RECOMPILE)';
64446412
END;
64456413

6446-
IF NOT EXISTS ( SELECT 1
6447-
FROM #SkipChecks
6448-
WHERE DatabaseName IS NULL AND CheckID = 39 )
6449-
BEGIN
6450-
6451-
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 39) WITH NOWAIT;
6452-
6453-
EXEC dbo.sp_MSforeachdb 'USE [?];
6454-
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
6455-
INSERT INTO #BlitzResults
6456-
(CheckID,
6457-
DatabaseName,
6458-
Priority,
6459-
FindingsGroup,
6460-
Finding,
6461-
URL,
6462-
Details)
6463-
SELECT DISTINCT 39,
6464-
N''?'',
6465-
150,
6466-
''Performance'',
6467-
''Inactive Tables Without Clustered Indexes'',
6468-
''https://www.brentozar.com/go/heaps'',
6469-
(''The ['' + DB_NAME() + ''] database has heaps - tables without a clustered index - that have not been queried since the last restart. These may be backup tables carelessly left behind.'')
6470-
FROM [?].sys.indexes i INNER JOIN [?].sys.objects o ON i.object_id = o.object_id
6471-
INNER JOIN [?].sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id
6472-
INNER JOIN sys.databases sd ON sd.name = N''?''
6473-
LEFT OUTER JOIN [?].sys.dm_db_index_usage_stats ius ON i.object_id = ius.object_id AND i.index_id = ius.index_id AND ius.database_id = sd.database_id
6474-
WHERE i.type_desc = ''HEAP'' AND COALESCE(NULLIF(ius.user_seeks,0), NULLIF(ius.user_scans,0), NULLIF(ius.user_lookups,0), NULLIF(ius.user_updates,0)) IS NULL
6475-
AND sd.name <> ''tempdb'' AND sd.name <> ''DWDiagnostics'' AND o.is_ms_shipped = 0 AND o.type <> ''S'' OPTION (RECOMPILE)';
6476-
END;
6477-
64786414
IF NOT EXISTS ( SELECT 1
64796415
FROM #SkipChecks
64806416
WHERE DatabaseName IS NULL AND CheckID = 46 )

0 commit comments

Comments
 (0)