BrentOzarULTD / SQL-Server-First-Responder-Kit

sp_Blitz, sp_BlitzCache, sp_BlitzFirst, sp_BlitzIndex, and other SQL Server scripts for health checks and performance tuning.
http://FirstResponderKit.org
Other
3.34k stars 992 forks source link

sp_BlitzIndex getting error when running for specific database #2729

Closed johnsonjkma closed 3 years ago

johnsonjkma commented 3 years ago

Version of the script @Version = '7.99', @VersionDate = '20200913'

What is the current behavior? When running for specific database or @GetAllADatabases = 1, returns the following error. Msg 50000, Level 16, State 1, Procedure sp_BlitzIndex, Line 2002 [Batch Start Line 0] HDMS_RF database failed to process. XML parsing: line 1, character 17, illegal name character

For Message output:

Starting run. sp_BlitzIndex(TM) v7.99 - September 13, 2020
Create temp tables.
Adding UQ index on #IndexSanity (database_id, object_id, index_id)
Number of databases to examine: 3
Checking partition counts to exclude databases with over 100 partitions
Starting loop through databases

HDMS_RF
Inserting data into #IndexColumns for clustered indexes and heaps
Inserting data into #IndexColumns for nonclustered indexes
Inserting data into #IndexSanity
Checking partition count
Preferring non-2012 syntax with LEFT JOIN to sys.dm_db_index_operational_stats
Inserting data into #IndexPartitionSanity
Inserting data into #MissingIndexes
Failure populating temp tables.
Last @dsql: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;WITH ColumnNamesWithDataTypes AS(SELECT id.index_handle,id.object_id,cn.IndexColumnType,STUFF((SELECT ', ' + cn_inner.ColumnName + ' ' +
            N' {' + CASE     WHEN ty.name IN ( 'varchar', 'char' ) THEN ty.name + '(' + CASE WHEN co.max_length = -1 THEN 'max' ELSE CAST(co.max_length AS VARCHAR(25)) END + ')'
                                WHEN ty.name IN ( 'nvarchar', 'nchar' ) THEN ty.name + '(' + CASE WHEN co.max_length = -1 THEN 'max' ELSE CAST(co.max_length / 2 AS VARCHAR(25)) END + ')'
                                WHEN ty.name IN ( 'decimal', 'numeric' ) THEN ty.name + '(' + CAST(co.precision AS VARCHAR(25)) + ', ' + CAST(co.scale AS VARCHAR(25)) + ')'
                                WHEN ty.name IN ( 'datetime2' ) THEN ty.name + '(' + CAST(co.scale AS VARCHAR(25)) + ')'
                                ELSE ty.name END + '}'
                FROM    sys.dm_db_missing_index_details AS id_inner
                CROSS APPLY(
                    SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Equality' AS IndexColumnType
                    FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id_inner.equality_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                    CROSS APPLY n.nodes('x') node(v)
                UNION ALL
                    SELECT  LTRIM(RTRIM(v.value(N'(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Inequality' AS IndexColumnType
                    FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id_inner.inequality_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                    CROSS APPLY n.nodes('x') node(v)
                UNION ALL
                    SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Included' AS IndexColumnType
                    FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id_inner.included_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                    CROSS APPLY n.nodes('x') node(v)
            )AS cn_inner        JOIN    [HDMS_RF].sys.columns AS co ON co.object_id = id_inner.object_id AND '[' + co.name + ']' = cn_inner.ColumnName
                JOIN    [HDMS_RF].sys.types AS ty ON ty.user_type_id = co.user_type_id 
                WHERE id_inner.index_handle = id.index_...
Msg 50000, Level 16, State 1, Procedure sp_BlitzIndex, Line 2002 [Batch Start Line 0]
HDMS_RF database failed to process. XML parsing: line 1, character 17, illegal name character

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior? Should return the normal list of Index recommends

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures? SQL Server 2014 SP3 Windows 2012R2 I'm actually not sure if this working in previous versions. I haven't really run sp_BlitzIndex on this database before.

**Here is the debug = 1

Starting run. sp_BlitzIndex(TM) v7.99 - September 13, 2020
Create temp tables.
Adding UQ index on #IndexSanity (database_id, object_id, index_id)
Number of databases to examine: 1
Checking partition counts to exclude databases with over 100 partitions
Starting loop through databases

Maintenance
Inserting data into #IndexColumns for clustered indexes and heaps
/* sp_BlitzIndex */
                SET LOCK_TIMEOUT 1000; /* To fix locking bug in sys.identity_columns. See Github issue #2176. */
                SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
                SELECT 7,
                    s.name,    
                    si.object_id, 
                    si.index_id, 
                    sc.key_ordinal, 
                    sc.is_included_column, 
                    sc.is_descending_key,
                    sc.partition_ordinal,
                    c.name as column_name, 
                    st.name as system_type_name,
                    c.max_length,
                    c.[precision],
                    c.[scale],
                    c.collation_name,
                    c.is_nullable,
                    c.is_identity,
                    c.is_computed,
                    c.is_replicated,
                    c.is_sparse,
                    c.is_filestream,
                    CAST(ic.seed_value AS DECIMAL(38,0)),
                    CAST(ic.increment_value AS DECIMAL(38,0)),
                    CAST(ic.last_value AS DECIMAL(38,0)),
                    ic.is_not_for_replication
                FROM    [Maintenance].sys.indexes si
                JOIN    [Maintenance].sys.columns c ON
                    si.object_id=c.object_id
                LEFT JOIN [Maintenance].sys.index_columns sc ON 
                    sc.object_id = si.object_id
                    and sc.index_id=si.index_id
                    AND sc.column_id=c.column_id
                LEFT JOIN [Maintenance].sys.identity_columns ic ON
                    c.object_id=ic.object_id and
                    c.column_id=ic.column_id
                JOIN [Maintenance].sys.types st ON 
                    c.system_type_id=st.system_type_id
                    AND c.user_type_id=st.user_type_id
                JOIN [Maintenance].sys.objects AS so  ON si.object_id = so.object_id
                                                                          AND so.is_ms_shipped = 0
                JOIN [Maintenance].sys.schemas AS s ON s.schema_id = so.schema_id
                WHERE si.index_id in (0,1) OPTION (RECOMPILE);

Inserting data into #IndexColumns for nonclustered indexes
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
                SELECT 7, 
                    s.name,    
                    si.object_id, 
                    si.index_id, 
                    sc.key_ordinal, 
                    sc.is_included_column, 
                    sc.is_descending_key,
                    sc.partition_ordinal,
                    c.name as column_name, 
                    st.name as system_type_name,
                    c.max_length,
                    c.[precision],
                    c.[scale],
                    c.collation_name,
                    c.is_nullable,
                    c.is_identity,
                    c.is_computed,
                    c.is_replicated,
                    c.is_sparse,
                    c.is_filestream                
                FROM    [Maintenance].sys.indexes AS si
                JOIN    [Maintenance].sys.columns AS c ON
                    si.object_id=c.object_id
                JOIN [Maintenance].sys.index_columns AS sc ON 
                    sc.object_id = si.object_id
                    and sc.index_id=si.index_id
                    AND sc.column_id=c.column_id
                JOIN [Maintenance].sys.types AS st ON 
                    c.system_type_id=st.system_type_id
                    AND c.user_type_id=st.user_type_id
                JOIN [Maintenance].sys.objects AS so  ON si.object_id = so.object_id
                                                                          AND so.is_ms_shipped = 0
                JOIN [Maintenance].sys.schemas AS s ON s.schema_id = so.schema_id
                WHERE si.index_id not in (0,1) OPTION (RECOMPILE);

Inserting data into #IndexSanity
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
                SELECT  7 AS database_id, 
                        so.object_id, 
                        si.index_id, 
                        si.type,
                        @i_DatabaseName AS database_name, 
                        COALESCE(sc.NAME, 'Unknown') AS [schema_name],
                        COALESCE(so.name, 'Unknown') AS [object_name], 
                        COALESCE(si.name, 'Unknown') AS [index_name],
                        CASE    WHEN so.[type] = CAST('V' AS CHAR(2)) THEN 1 ELSE 0 END, 
                        si.is_unique, 
                        si.is_primary_key, 
                        CASE when si.type = 3 THEN 1 ELSE 0 END AS is_XML,
                        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.data_space_id = 0 then 1 else 0 end as is_in_memory_oltp,
                        si.is_disabled,
                        si.is_hypothetical, 
                        si.is_padded, 
                        si.fill_factor,
                        CASE WHEN si.filter_definition IS NOT NULL THEN si.filter_definition
                             ELSE N''
                        END AS filter_definition
                        , ISNULL(us.user_seeks, 0),
                        ISNULL(us.user_scans, 0),
                        ISNULL(us.user_lookups, 0),
                        ISNULL(us.user_updates, 0),
                        us.last_user_seek,
                        us.last_user_scan,
                        us.last_user_lookup,
                        us.last_user_update,
                        so.create_date,
                        so.modify_date
                FROM    [Maintenance].sys.indexes AS si WITH (NOLOCK)
                        JOIN [Maintenance].sys.objects AS so WITH (NOLOCK) ON si.object_id = so.object_id
                                               AND so.is_ms_shipped = 0 /*Exclude objects shipped by Microsoft*/
                                               AND so.type <> 'TF' /*Exclude table valued functions*/
                        JOIN [Maintenance].sys.schemas sc ON so.schema_id = sc.schema_id
                        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 = 7
                WHERE    si.[type] IN ( 0, 1, 2, 3, 4, 5, 6 ) 
                /* Heaps, clustered, nonclustered, XML, spatial, Cluster Columnstore, NC Columnstore */ AND ( us.user_seeks + us.user_scans + us.user_lookups + us.user_updates ) > 0OPTION    ( RECOMPILE );

Checking partition count
Preferring non-2012 syntax with LEFT JOIN to sys.dm_db_index_operational_stats
Inserting data into #IndexPartitionSanity
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
                        SELECT  7 AS database_id,
                                ps.object_id, 
                                s.name,
                                ps.index_id, 
                                ps.partition_number, 
                                ps.row_count,
                                ps.reserved_page_count * 8. / 1024. AS reserved_MB,
                                ps.lob_reserved_page_count * 8. / 1024. AS reserved_LOB_MB,
                                ps.row_overflow_reserved_page_count * 8. / 1024. AS reserved_row_overflow_MB,
                                le.lock_escalation_desc,
                            par.data_compression_desc ,
                                SUM(os.leaf_insert_count), 
                                SUM(os.leaf_delete_count), 
                                SUM(os.leaf_update_count), 
                                SUM(os.range_scan_count), 
                                SUM(os.singleton_lookup_count),  
                                SUM(os.forwarded_fetch_count),
                                SUM(os.lob_fetch_in_pages), 
                                SUM(os.lob_fetch_in_bytes), 
                                SUM(os.row_overflow_fetch_in_pages),
                                SUM(os.row_overflow_fetch_in_bytes), 
                                SUM(os.row_lock_count), 
                                SUM(os.row_lock_wait_count),
                                SUM(os.row_lock_wait_in_ms), 
                                SUM(os.page_lock_count), 
                                SUM(os.page_lock_wait_count), 
                                SUM(os.page_lock_wait_in_ms),
                                SUM(os.index_lock_promotion_attempt_count), 
                                SUM(os.index_lock_promotion_count), 
                                SUM(os.page_latch_wait_count),
                                SUM(os.page_latch_wait_in_ms),
                                SUM(os.page_io_latch_wait_count),                               
                                SUM(os.page_io_latch_wait_in_ms)
                    FROM    [Maintenance].sys.dm_db_partition_stats AS ps  
                    JOIN [Maintenance].sys.partitions AS par on ps.partition_id=par.partition_id
                    JOIN [Maintenance].sys.objects AS so ON ps.object_id = so.object_id
                               AND so.is_ms_shipped = 0 /*Exclude objects shipped by Microsoft*/
                               AND so.type <> 'TF' /*Exclude table valued functions*/
                    JOIN [Maintenance].sys.schemas AS s ON s.schema_id = so.schema_id
                    LEFT JOIN [Maintenance].sys.dm_db_index_operational_stats(7, NULL, NULL,NULL) AS os ON
                    ps.object_id=os.object_id and ps.index_id=os.index_id and ps.partition_number=os.partition_number 
                        OUTER APPLY (SELECT st.lock_escalation_desc
                                     FROM [Maintenance].sys.tables st
                                     WHERE st.object_id = ps.object_id
                                         AND ps.index_id < 2 ) le
                    WHERE 1=1 

            GROUP BY ps.object_id, 
                                s.name,
                                ps.index_id, 
                                ps.partition_number, 
                                ps.row_count,
                                ps.reserved_page_count,
                                ps.lob_reserved_page_count,
                                ps.row_overflow_reserved_page_count,
                                le.lock_escalation_desc,
                            par.data_compression_desc 
            ORDER BY ps.object_id,  ps.index_id, ps.partition_number
            OPTION    ( RECOMPILE );

Inserting data into #MissingIndexes
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;WITH ColumnNamesWithDataTypes AS(SELECT id.index_handle,id.object_id,cn.IndexColumnType,STUFF((SELECT ', ' + cn_inner.ColumnName + ' ' +
            N' {' + CASE     WHEN ty.name IN ( 'varchar', 'char' ) THEN ty.name + '(' + CASE WHEN co.max_length = -1 THEN 'max' ELSE CAST(co.max_length AS VARCHAR(25)) END + ')'
                                WHEN ty.name IN ( 'nvarchar', 'nchar' ) THEN ty.name + '(' + CASE WHEN co.max_length = -1 THEN 'max' ELSE CAST(co.max_length / 2 AS VARCHAR(25)) END + ')'
                                WHEN ty.name IN ( 'decimal', 'numeric' ) THEN ty.name + '(' + CAST(co.precision AS VARCHAR(25)) + ', ' + CAST(co.scale AS VARCHAR(25)) + ')'
                                WHEN ty.name IN ( 'datetime2' ) THEN ty.name + '(' + CAST(co.scale AS VARCHAR(25)) + ')'
                                ELSE ty.name END + '}'
                FROM    sys.dm_db_missing_index_details AS id_inner
                CROSS APPLY(
                    SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Equality' AS IndexColumnType
                    FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id_inner.equality_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                    CROSS APPLY n.nodes('x') node(v)
                UNION ALL
                    SELECT  LTRIM(RTRIM(v.value(N'(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Inequality' AS IndexColumnType
                    FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id_inner.inequality_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                    CROSS APPLY n.nodes('x') node(v)
                UNION ALL
                    SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Included' AS IndexColumnType
                    FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id_inner.included_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                    CROSS APPLY n.nodes('x') node(v)
            )AS cn_inner        JOIN    [Maintenance].sys.columns AS co ON co.object_id = id_inner.object_id AND '[' + co.name + ']' = cn_inner.ColumnName
                JOIN    [Maintenance].sys.types AS ty ON ty.user_type_id = co.user_type_id 
                WHERE id_inner.index_handle = id.index_handle
                AND id_inner.object_id = id.object_id
                AND cn_inner.IndexColumnType = cn.IndexColumnType
                FOR XML PATH('')
             ),1,1,'') AS ReplaceColumnNames
            FROM sys.dm_db_missing_index_details AS id
           CROSS APPLY(
                        SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Equality' AS IndexColumnType
                        FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id.equality_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                        CROSS APPLY n.nodes('x') node(v)
                    UNION ALL
                        SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Inequality' AS IndexColumnType
                        FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id.inequality_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                        CROSS APPLY n.nodes('x') node(v)
                    UNION ALL
                        SELECT  LTRIM(RTRIM(v.value('(./text())[1]', 'varchar(max)'))) AS ColumnName, 'Included' AS IndexColumnType
                        FROM    (VALUES (CONVERT(XML, N'<x>' + REPLACE(CAST(id.included_columns AS nvarchar(max)), N',', N'</x><x>') + N'</x>'))) x(n)
                        CROSS APPLY n.nodes('x') node(v)
                    )AS cn
                GROUP BY    id.index_handle,id.object_id,cn.IndexColumnType
                )
                SELECT  id.database_id, id.object_id, @i_DatabaseName, sc.[name], so.[name], id.statement , gs.avg_total_user_cost, 
                        gs.avg_user_impact, gs.user_seeks, gs.user_scans, gs.unique_compiles, id.equality_columns, id.inequality_columns, id.included_columns,
                (
                    SELECT ColumnNamesWithDataTypes.ReplaceColumnNames 
                    FROM ColumnNamesWithDataTypes WHERE ColumnNamesWithDataTypes.index_handle = id.index_handle
                    AND ColumnNamesWithDataTypes.object_id = id.object_id
                    AND ColumnNamesWithDataTypes.IndexColumnType = 'Equality'
                ) AS equality_columns_with_data_type
                ,(

 SELECT ColumnNamesWithDataTypes.ReplaceColumnNames 
                    FROM ColumnNamesWithDataTypes WHERE ColumnNamesWithDataTypes.index_handle = id.index_handle
                    AND ColumnNamesWithDataTypes.object_id = id.object_id
                    AND ColumnNamesWithDataTypes.IndexColumnType = 'Inequality'
                ) AS inequality_columns_with_data_type
                ,(
                    SELECT ColumnNamesWithDataTypes.ReplaceColumnNames 
                    FROM ColumnNamesWithDataTypes WHERE ColumnNamesWithDataTypes.index_handle = id.index_handle
                    AND ColumnNamesWithDataTypes.object_id = id.object_id
                    AND ColumnNamesWithDataTypes.IndexColumnType = 'Included'
                ) AS included_columns_with_data_type
                FROM    sys.dm_db_missing_index_groups ig
                        JOIN sys.dm_db_missing_index_details id ON ig.index_handle = id.index_handle
                        JOIN sys.dm_db_missing_index_group_stats gs ON ig.index_group_handle = gs.group_handle
                        JOIN [Maintenance].sys.objects so on 
                            id.object_id=so.object_id
                        JOIN [Maintenance].sys.schemas sc on 
                            so.schema_id=sc.schema_id
                WHERE    id.database_id = 7
                OPTION (RECOMPILE);

Inserting data into #ForeignKeys

            SELECT DB_ID(N'Maintenance') AS [database_id], 
                @i_DatabaseName AS database_name,
                s.name,
                fk_object.name AS foreign_key_name,
                parent_object.[object_id] AS parent_object_id,
                parent_object.name AS parent_object_name,
                referenced_object.[object_id] AS referenced_object_id,
                referenced_object.name AS referenced_object_name,
                fk.is_disabled,
                fk.is_not_trusted,
                fk.is_not_for_replication,
                parent.fk_columns,
                referenced.fk_columns,
                [update_referential_action_desc],
                [delete_referential_action_desc]
            FROM [Maintenance].sys.foreign_keys fk
            JOIN [Maintenance].sys.objects fk_object ON fk.object_id=fk_object.object_id
            JOIN [Maintenance].sys.objects parent_object ON fk.parent_object_id=parent_object.object_id
            JOIN [Maintenance].sys.objects referenced_object ON fk.referenced_object_id=referenced_object.object_id
            JOIN [Maintenance].sys.schemas AS s ON fk.schema_id=s.schema_id
            CROSS APPLY ( SELECT  STUFF( (SELECT  N', ' + c_parent.name AS fk_columns
                                            FROM    [Maintenance].sys.foreign_key_columns fkc 
                                            JOIN [Maintenance].sys.columns c_parent ON fkc.parent_object_id=c_parent.[object_id]
                                                AND fkc.parent_column_id=c_parent.column_id
                                            WHERE    fk.parent_object_id=fkc.parent_object_id
                                                AND fk.[object_id]=fkc.constraint_object_id
                                            ORDER BY fkc.constraint_column_id 
                                    FOR      XML PATH('') ,
                                              TYPE).value('.', 'nvarchar(max)'), 1, 1, '')/*This is how we remove the first comma*/ ) parent ( fk_columns )
            CROSS APPLY ( SELECT  STUFF( (SELECT  N', ' + c_referenced.name AS fk_columns
                                            FROM    [Maintenance].sys.    foreign_key_columns fkc 
                                            JOIN [Maintenance].sys.columns c_referenced ON fkc.referenced_object_id=c_referenced.[object_id]
                                                AND fkc.referenced_column_id=c_referenced.column_id
                                            WHERE    fk.referenced_object_id=fkc.referenced_object_id
                                                and fk.[object_id]=fkc.constraint_object_id
                                            ORDER BY fkc.constraint_column_id  /*order by col name, we don't have anything better*/
                                    FOR      XML PATH('') ,
                                              TYPE).value('.', 'nvarchar(max)'), 1, 1, '') ) referenced ( fk_columns )

            ORDER BY parent_object_name, foreign_key_name
            OPTION (RECOMPILE);

Gathering Computed Column Info.
Gathering Trace Flag Information
Updating #IndexSanity.key_column_names
Updating #IndexSanity.partition_key_column_name
Updating #IndexSanity.key_column_names_with_sort_order
Updating #IndexSanity.key_column_names_with_sort_order_no_types (for create tsql)
Updating #IndexSanity.include_column_names
Updating #IndexSanity.include_column_names_no_types (for create tsql)
Updating #IndexSanity.count_key_columns and count_include_columns
Updating index_sanity_id on #IndexPartitionSanity
Inserting data into #IndexSanitySize
Determining index usefulness
Updating #IndexSanity.referenced_by_foreign_key
Update index_secret on #IndexSanity for NC indexes.
Update index_secret on #IndexSanity for heaps and non-unique clustered.
Populate #IndexCreateTsql.
Populate #PartitionCompressionInfo.
Update #PartitionCompressionInfo.
Update #IndexSanity for filtered indexes with columns not in the index definition.
@Mode=0 or 4, we are diagnosing.
check_id 1: Duplicate keys
check_id 2: Keys w/ identical leading columns.
check_id 11: Total lock wait time > 5 minutes (row + page) with long average waits
check_id 12: Total lock wait time > 5 minutes (row + page) with short average waits
check_id 20: >=7 NC indexes on any given table. Yes, 7 is an arbitrary number.
check_id 21: >=5 percent of indexes are unused. Yes, 5 is an arbitrary number.
check_id 22: NC indexes with 0 reads. (Borderline) and >= 10,000 writes
check_id 23: Indexes with 7 or more columns. (Borderline)
check_id 24: Wide clustered indexes (> 3 columns or > 16 bytes).
check_id 25: Addicted to nullable columns.
check_id 26: Wide tables (35+ cols or > 2000 non-LOB bytes).
check_id 27: Addicted to strings.
check_id 28: Non-unique clustered index.
check_id 29: NC indexes with 0 reads. (Borderline) and < 10,000 writes
check_id 30: No indexes with includes
check_id 31: < 3 percent of indexes have includes
check_id 32: filtered indexes and indexed views
check_id 33: Potential filtered indexes based on column names.
check_id 34: Filtered index definition columns not in index definition
check_id 40: Fillfactor in nonclustered 80 percent or less
check_id 40: Fillfactor in clustered 80 percent or less
check_id 41: Hypothetical indexes 
check_id 42: Disabled indexes
check_id 43: Heaps with forwarded records
check_id 49: Heaps with deletes
check_id 44: Large Heaps with reads or writes.
check_id 45: Medium Heaps with reads or writes.
check_id 46: Small Heaps with reads or writes.
check_id 47: Heap with a Nonclustered Primary Key
check_id 48: Nonclustered indexes with a bad read to write ratio
check_id 50: Indexaphobia.
check_id 60: XML indexes
check_id 61: Columnstore indexes
check_id 62: Spatial indexes
check_id 63: Compressed indexes
check_id 64: Partitioned
check_id 65: Non-Aligned Partitioned
check_id 66: Recently created tables/indexes (1 week)
check_id 67: Recently modified tables/indexes (2 days)
check_id 68: Identity columns within 30 percent of the end of range
check_id 69: Column collation does not match database collation
check_id 70: Replicated columns
check_id 71: Cascading updates or cascading deletes.
check_id 72: Columnstore indexes with Trace Flag 834
check_id 73: In-Memory OLTP
check_id 80: Most scanned indexes (index_usage_stats)
check_id 81: Top recent accesses (op stats)
check_id 90: Outdated statistics
check_id 91: Statistics with a low sample rate
check_id 92: Statistics with NO RECOMPUTE
check_id 93: Statistics with filters
check_id 99: Computed Columns That Reference Functions
check_id 100: Computed Columns that are not Persisted.
check_id 110: Temporal Tables.
check_id 120: Check Constraints That Reference Functions
Insert a row to help people find help
Returning results.
BrentOzar commented 3 years ago

Hi, and welcome to the repo. Yes, this can indeed happen with really wildly named objects that break XML. Unfortunately, we don't have a fix coming on our side - your best bet there would be to identify which objects have wildly unusual names, and then see if you can reproduce the specific issue in sp_BlitzIndex by creating a new empty database, and just that one table or index with that name. If you can give us a repro script, we may be able to help, but otherwise, this isn't something we're going to be able to work on.