Skip to content

Commit 37b2636

Browse files
authored
Merge pull request #1847 from BrentOzarULTD/issue_1843
Up stats mod counter
2 parents 1edb4e7 + 8bb7541 commit 37b2636

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

sp_BlitzCache.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ CREATE TABLE #stats_agg
12241224
(
12251225
SqlHandle VARBINARY(64),
12261226
LastUpdate DATETIME2(7),
1227-
ModificationCount INT,
1227+
ModificationCount BIGINT,
12281228
SamplingPercent FLOAT,
12291229
[Statistics] NVARCHAR(258),
12301230
[Table] NVARCHAR(258),
@@ -3261,7 +3261,7 @@ WITH XMLNAMESPACES('http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS
32613261
INSERT INTO #stats_agg
32623262
SELECT qp.SqlHandle,
32633263
x.c.value('@LastUpdate', 'DATETIME2(7)') AS LastUpdate,
3264-
x.c.value('@ModificationCount', 'INT') AS ModificationCount,
3264+
x.c.value('@ModificationCount', 'BIGINT') AS ModificationCount,
32653265
x.c.value('@SamplingPercent', 'FLOAT') AS SamplingPercent,
32663266
x.c.value('@Statistics', 'NVARCHAR(258)') AS [Statistics],
32673267
x.c.value('@Table', 'NVARCHAR(258)') AS [Table],

sp_BlitzIndex.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,12 +1828,6 @@ SELECT
18281828
CASE WHEN is_disabled = 1 AND index_id <> 1
18291829
THEN N'--DROP INDEX ' + QUOTENAME([index_name]) + N' ON '
18301830
+ QUOTENAME([schema_name]) + N'.' + QUOTENAME([object_name])
1831-
WHEN index_name LIKE '[_]dta[_]index%'
1832-
THEN N'-- EXEC sys.sp_rename @objname = N' + QUOTENAME(db_schema_object_name + N'.' + index_name, N'''') + NCHAR(10) +
1833-
N', @newname = N' + QUOTENAME(LEFT(N'ix_' + [object_name]
1834-
+ REPLACE(REPLACE(REPLACE(REPLACE(key_column_names_with_sort_order_no_types, N' ', N'_'), N'[', N''), N']', N''), ',', '')
1835-
+ CASE WHEN count_included_columns > 0 THEN N'_Includes' ELSE N'' END, 128), '''') + NCHAR(10) +
1836-
N', @objtype = N' + QUOTENAME(N'INDEX', '''')
18371831
ELSE
18381832
CASE index_id WHEN 0 THEN N'ALTER TABLE ' + QUOTENAME([database_name]) + N'.' + QUOTENAME([schema_name]) + N'.' + QUOTENAME([object_name]) + ' REBUILD;'
18391833
ELSE

sp_BlitzQueryStore.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ CREATE TABLE #stats_agg
739739
(
740740
sql_handle VARBINARY(64),
741741
last_update DATETIME2,
742-
modification_count DECIMAL(38, 2),
742+
modification_count BIGINT,
743743
sampling_percent DECIMAL(38, 2),
744744
[statistics] NVARCHAR(258),
745745
[table] NVARCHAR(258),
@@ -2995,7 +2995,7 @@ INSERT #stats_agg WITH (TABLOCK)
29952995
(sql_handle, last_update, modification_count, sampling_percent, [statistics], [table], [schema], [database])
29962996
SELECT qp.sql_handle,
29972997
x.c.value('@LastUpdate', 'DATETIME2(7)') AS LastUpdate,
2998-
x.c.value('@ModificationCount', 'INT') AS ModificationCount,
2998+
x.c.value('@ModificationCount', 'BIGINT') AS ModificationCount,
29992999
x.c.value('@SamplingPercent', 'FLOAT') AS SamplingPercent,
30003000
x.c.value('@Statistics', 'NVARCHAR(258)') AS [Statistics],
30013001
x.c.value('@Table', 'NVARCHAR(258)') AS [Table],

0 commit comments

Comments
 (0)