Skip to content

Commit

Permalink
Merge pull request #1847 from BrentOzarULTD/issue_1843
Browse files Browse the repository at this point in the history
Up stats mod counter
  • Loading branch information
BlitzErik committed Nov 13, 2018
2 parents 1edb4e7 + 8bb7541 commit 37b2636
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions sp_BlitzCache.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ CREATE TABLE #stats_agg
(
SqlHandle VARBINARY(64),
LastUpdate DATETIME2(7),
ModificationCount INT,
ModificationCount BIGINT,
SamplingPercent FLOAT,
[Statistics] NVARCHAR(258),
[Table] NVARCHAR(258),
Expand Down Expand Up @@ -3261,7 +3261,7 @@ WITH XMLNAMESPACES('http://schemas.microsoft.com/sqlserver/2004/07/showplan' AS
INSERT INTO #stats_agg
SELECT qp.SqlHandle,
x.c.value('@LastUpdate', 'DATETIME2(7)') AS LastUpdate,
x.c.value('@ModificationCount', 'INT') AS ModificationCount,
x.c.value('@ModificationCount', 'BIGINT') AS ModificationCount,
x.c.value('@SamplingPercent', 'FLOAT') AS SamplingPercent,
x.c.value('@Statistics', 'NVARCHAR(258)') AS [Statistics],
x.c.value('@Table', 'NVARCHAR(258)') AS [Table],
Expand Down
6 changes: 0 additions & 6 deletions sp_BlitzIndex.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1828,12 +1828,6 @@ SELECT
CASE WHEN is_disabled = 1 AND index_id <> 1
THEN N'--DROP INDEX ' + QUOTENAME([index_name]) + N' ON '
+ QUOTENAME([schema_name]) + N'.' + QUOTENAME([object_name])
WHEN index_name LIKE '[_]dta[_]index%'
THEN N'-- EXEC sys.sp_rename @objname = N' + QUOTENAME(db_schema_object_name + N'.' + index_name, N'''') + NCHAR(10) +
N', @newname = N' + QUOTENAME(LEFT(N'ix_' + [object_name]
+ REPLACE(REPLACE(REPLACE(REPLACE(key_column_names_with_sort_order_no_types, N' ', N'_'), N'[', N''), N']', N''), ',', '')
+ CASE WHEN count_included_columns > 0 THEN N'_Includes' ELSE N'' END, 128), '''') + NCHAR(10) +
N', @objtype = N' + QUOTENAME(N'INDEX', '''')
ELSE
CASE index_id WHEN 0 THEN N'ALTER TABLE ' + QUOTENAME([database_name]) + N'.' + QUOTENAME([schema_name]) + N'.' + QUOTENAME([object_name]) + ' REBUILD;'
ELSE
Expand Down
4 changes: 2 additions & 2 deletions sp_BlitzQueryStore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ CREATE TABLE #stats_agg
(
sql_handle VARBINARY(64),
last_update DATETIME2,
modification_count DECIMAL(38, 2),
modification_count BIGINT,
sampling_percent DECIMAL(38, 2),
[statistics] NVARCHAR(258),
[table] NVARCHAR(258),
Expand Down Expand Up @@ -2995,7 +2995,7 @@ INSERT #stats_agg WITH (TABLOCK)
(sql_handle, last_update, modification_count, sampling_percent, [statistics], [table], [schema], [database])
SELECT qp.sql_handle,
x.c.value('@LastUpdate', 'DATETIME2(7)') AS LastUpdate,
x.c.value('@ModificationCount', 'INT') AS ModificationCount,
x.c.value('@ModificationCount', 'BIGINT') AS ModificationCount,
x.c.value('@SamplingPercent', 'FLOAT') AS SamplingPercent,
x.c.value('@Statistics', 'NVARCHAR(258)') AS [Statistics],
x.c.value('@Table', 'NVARCHAR(258)') AS [Table],
Expand Down

0 comments on commit 37b2636

Please sign in to comment.