Skip to content

Commit 9aca6e2

Browse files
committed
New check id 128
1 parent 5184a1b commit 9aca6e2

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

Documentation/sp_BlitzIndex_Checks_by_Priority.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav
66

77
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.
88

9-
CURRENT HIGH CHECKID: 127
10-
If you want to add a new check, start at 128.
9+
CURRENT HIGH CHECKID: 128
10+
If you want to add a new check, start at 129.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
| -------- | ----------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------- |
@@ -36,6 +36,7 @@ If you want to add a new check, start at 128.
3636
| 100 | Indexes Worth Reviewing | Low Fill Factor on Nonclustered Index | https://www.brentozar.com/go/SelfLoathing | 40 |
3737
| 100 | Indexes Worth Reviewing | Medium Active Heap | https://www.brentozar.com/go/SelfLoathing | 45 |
3838
| 100 | Indexes Worth Reviewing | Small Active Heap | https://www.brentozar.com/go/SelfLoathing | 46 |
39+
| 100 | Indexes Worth Reviewing | Heap with PAGE compression | https://vladdba.com/PageCompressedHeaps | 128 |
3940
| 100 | Forced Serialization | Computed Column with Scalar UDF | https://www.brentozar.com/go/serialudf | 99 |
4041
| 100 | Forced Serialization | Check Constraint with Scalar UDF | https://www.brentozar.com/go/computedscalar | 94 |
4142
| 150 | Abnormal Design Pattern | Cascading Updates or Deletes | https://www.brentozar.com/go/AbnormalPsychology | 71 |

sp_BlitzIndex.sql

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4382,6 +4382,29 @@ BEGIN
43824382
)
43834383
OPTION ( RECOMPILE );
43844384

4385+
4386+
RAISERROR(N'check_id 128: Heaps with PAGE compression.', 0,1) WITH NOWAIT;
4387+
INSERT #BlitzIndexResults ( check_id, index_sanity_id, Priority, findings_group, finding, [database_name], URL, details, index_definition,
4388+
secret_columns, index_usage_summary, index_size_summary )
4389+
SELECT 128 AS check_id,
4390+
i.index_sanity_id,
4391+
100 AS Priority,
4392+
N'Indexes Worth Reviewing' AS findings_group,
4393+
N'Heap with PAGE compression' AS finding,
4394+
[database_name] AS [Database Name],
4395+
N'https://vladdba.com/PageCompressedHeaps' AS URL,
4396+
N'Should this table be a heap? ' + db_schema_object_indexid AS details,
4397+
i.index_definition,
4398+
'N/A' AS secret_columns,
4399+
i.index_usage_summary,
4400+
sz.index_size_summary
4401+
FROM #IndexSanity i
4402+
JOIN #IndexSanitySize sz ON i.index_sanity_id = sz.index_sanity_id
4403+
WHERE i.index_id = 0
4404+
AND (i.total_reads > 0 OR i.user_updates > 0) /*it doesn't matter that much if it's not active*/
4405+
AND sz.data_compression_desc LIKE '%PAGE%' /*using LIKE here because there are some variations for this value*/
4406+
OPTION ( RECOMPILE );
4407+
43854408
RAISERROR(N'check_id 48: Nonclustered indexes with a bad read to write ratio', 0,1) WITH NOWAIT;
43864409
INSERT #BlitzIndexResults ( check_id, index_sanity_id, Priority, findings_group, finding, [database_name], URL, details, index_definition,
43874410
secret_columns, index_usage_summary, index_size_summary )
@@ -4723,8 +4746,7 @@ BEGIN
47234746
FROM #ComputedColumns AS cc
47244747
WHERE cc.is_function = 1
47254748
OPTION ( RECOMPILE );
4726-
4727-
4749+
47284750

47294751
END /* IF @Mode IN (0, 4) DIAGNOSE priorities 1-100 */
47304752

0 commit comments

Comments
 (0)