diff --git a/sp_BlitzIndex.sql b/sp_BlitzIndex.sql index 6bb04e879..ca17092d0 100644 --- a/sp_BlitzIndex.sql +++ b/sp_BlitzIndex.sql @@ -329,6 +329,7 @@ IF OBJECT_ID('tempdb..#dm_db_index_operational_stats') IS NOT NULL is_spatial BIT NOT NULL, is_NC_columnstore BIT NOT NULL, is_CX_columnstore BIT NOT NULL, + is_JSON BIT NOT NULL, is_in_memory_oltp BIT NOT NULL , is_disabled BIT NOT NULL , is_hypothetical BIT NOT NULL , @@ -370,6 +371,7 @@ IF OBJECT_ID('tempdb..#dm_db_index_operational_stats') IS NOT NULL ELSE N'' END + CASE WHEN is_XML = 1 THEN N'[XML] ' ELSE N'' END + CASE WHEN is_spatial = 1 THEN N'[SPATIAL] ' ELSE N'' END + CASE WHEN is_NC_columnstore = 1 THEN N'[COLUMNSTORE] ' + ELSE N'' END + CASE WHEN is_json = 1 THEN N'[JSON] ' ELSE N'' END + CASE WHEN is_in_memory_oltp = 1 THEN N'[IN-MEMORY] ' ELSE N'' END + CASE WHEN is_disabled = 1 THEN N'[DISABLED] ' ELSE N'' END + CASE WHEN is_hypothetical = 1 THEN N'[HYPOTHETICAL] ' @@ -1414,6 +1416,7 @@ BEGIN TRY CASE when si.type = 4 THEN 1 ELSE 0 END AS is_spatial, CASE when si.type = 6 THEN 1 ELSE 0 END AS is_NC_columnstore, CASE when si.type = 5 then 1 else 0 end as is_CX_columnstore, + CASE when si.type = 9 then 1 else 0 end as is_JSON, CASE when si.data_space_id = 0 then 1 else 0 end as is_in_memory_oltp, si.is_disabled, si.is_hypothetical, @@ -1447,8 +1450,8 @@ BEGIN TRY LEFT JOIN sys.dm_db_index_usage_stats AS us WITH (NOLOCK) ON si.[object_id] = us.[object_id] AND si.index_id = us.index_id AND us.database_id = ' + CAST(@DatabaseID AS NVARCHAR(10)) + N' - WHERE si.[type] IN ( 0, 1, 2, 3, 4, 5, 6 ) - /* Heaps, clustered, nonclustered, XML, spatial, Cluster Columnstore, NC Columnstore */ ' + + WHERE si.[type] IN ( 0, 1, 2, 3, 4, 5, 6, 9 ) + /* Heaps, clustered, nonclustered, XML, spatial, Cluster Columnstore, NC Columnstore, JSON */ ' + CASE WHEN @TableName IS NOT NULL THEN N' and so.name=' + QUOTENAME(@TableName,N'''') + N' ' ELSE N'' END + CASE WHEN ( @IncludeInactiveIndexes = 0 AND @Mode IN (0, 4) @@ -1476,7 +1479,7 @@ BEGIN TRY PRINT SUBSTRING(@dsql, 36000, 40000); END; INSERT #IndexSanity ( [database_id], [object_id], [index_id], [index_type], [database_name], [schema_name], [object_name], - index_name, is_indexed_view, is_unique, is_primary_key, is_unique_constraint, is_XML, is_spatial, is_NC_columnstore, is_CX_columnstore, is_in_memory_oltp, + index_name, is_indexed_view, is_unique, is_primary_key, is_unique_constraint, is_XML, is_spatial, is_NC_columnstore, is_CX_columnstore, is_JSON, is_in_memory_oltp, is_disabled, is_hypothetical, is_padded, fill_factor, filter_definition, [optimize_for_sequential_key], user_seeks, user_scans, user_lookups, user_updates, last_user_seek, last_user_scan, last_user_lookup, last_user_update, create_date, modify_date )