SQL Server: Index creation and conversion issues with columnstore indexes — Encountering internal query processor errors

Nacho Cotanda Portoles 0 Reputation points
2026-10-07T14:22:11.1166667+00:00

Problem description

I am experiencing issues when creating or converting indexes on a table with existing data in SQL Server running on an Azure VM. Specifically, when I attempt to create or modify clustered columnstore indexes with options like DATA_COMPRESSION = COLUMNSTORE or changing to a clustered index with DROP_EXISTING and DATA_COMPRESSION = PAGE, the operation fails in many cases. The error returned is an internal query processor error: "The query processor could not obtain access to a required interface." The failure occurs both when creating the index from scratch and during conversions involving DROP_EXISTING. I have tried recreating the table with minimal data, and the issue persists even with a single row. The environment is SQL Server 2022, but the issue also occurs in SQL Server 2025. I have also checked for any related memory or DOP warnings, but none are reported. The table in question has no constraints or duplicates, and the process fails during index operations on a table with data, regardless of the data size.

Environment

The affected environment is SQL Server on a Windows virtual machine in Azure. The table is named [dbo].[table], and the server is running SQL Server 2022 or 2025 with the specified build. The issue occurs when creating or altering indexes on this table with existing data.

What I've already tried

I have attempted recreating the table with a small number of rows and reproducing the issue. The problem occurs even with a single row. I have not observed any SQL Server or Windows Event Viewer errors related to memory or tempdb during index creation. I also performed a backup and restore to test with a clean environment. No constraints or dependencies are involved, and the table's structure is well-defined without duplicates.

Current status

Currently, I am unable to determine whether this is a bug in SQL Server or a specific environmental issue. I am seeking guidance on how to gather more detailed diagnostic information, such as the exact error messages, the SQL Server version details, and the behaviors during index creation and conversion. Any suggestions on further troubleshooting steps or potential workarounds would be appreciated.

SQL Server Database Engine

2 answers

Sort by: Most helpful
  1. Deepesh Dhake 1,245 Reputation points
    2026-10-08T13:42:44.6766667+00:00

    That message is error 8601. Microsoft has fixed several 8601 bugs involving columnstore in past CUs (KB2981764, KB3172959).

    Converting a clustered columnstore index to a rowstore clustered index with DROP_EXISTING = ON is supported, so an internal QP error here is not expected behavior.

    Tests to narrow it down

    Retry the conversion with one change at a time:

    1. Remove SORT_IN_TEMPDB = ON
    2. Remove DATA_COMPRESSION = PAGE
    3. Add MAXDOP = 1
    4. First run ALTER INDEX [CCI] ON [dbo].[table] REORGANIZE WITH (COMPRESS_ALL_ROW_GROUPS = ON);, then retry

    The reason for test 4: with this few rows, the data is in an open delta rowgroup, not compressed segments. You can confirm that with sys.dm_db_column_store_row_group_physical_stats. Whether that matters for the bug is untested.

    To capture more detail

    Run an Extended Events session on error_reported, filtered to error_number = 8601, with the tsql_stack action. Also check the SQL Server LOG folder for any SQLDump* files from the time of the failure.

    Workaround to try

    Use DROP INDEX [CCI], then a separate CREATE CLUSTERED INDEX ... WITH (DATA_COMPRESSION = PAGE).

    Was this answer helpful?

    0 comments No comments

  2. Francisco Aguado Ruiz 0 Reputation points
    2026-10-08T08:57:26.4533333+00:00

    That's the code for SQL Server 2022. In SQL 2025 it seems to be more difficult to be generated, but I have a table in SQL 2025 with the same problem. Is it enough?
    drop table [dbo].[table]

    CREATE TABLE [dbo].[table](

    [Id] [bigint] IDENTITY(1,1) NOT NULL,
    
    [server_name] [nvarchar](128) NOT NULL,
    
    [collected_date] [datetimeoffset](7) NOT NULL,
    
    [database_name] [nvarchar](128) NULL,
    
    [table_name] [nvarchar](128) NULL,
    
    [equality_columns] [nvarchar](4000) NULL,
    
    [inequality_columns] [nvarchar](4000) NULL,
    
    [included_columns] [nvarchar](4000) NULL,
    
    [impact] [bigint] NULL,
    
    [user_seeks] [bigint] NULL,
    
    [query_hash] [nvarchar](64) NULL,
    
    [query_plan_hash] [nvarchar](64) NULL,
    
    [first_seen_date] [datetimeoffset](7) NULL,
    
    [last_seen_date] [datetimeoffset](7) NULL,
    
    [appearance_count] [int] NULL
    

    ) ON [PRIMARY]

    GO

    /****** Object: Index [CCI_db_missing_indexes_stats] Script Date: 05/10/2026 13:31:01 ******/

    CREATE CLUSTERED COLUMNSTORE INDEX [CCI] ON [dbo].[table] WITH (DROP_EXISTING = OFF, COMPRESSION_DELAY = 0, DATA_COMPRESSION = COLUMNSTORE) ON [PRIMARY]

    GO

    SET NOCOUNT ON

    DECLARE @NumRegistros INT = 1000; -- Cantidad de registros a insertar

    DECLARE @i INT = 0;

    WHILE @i < @NumRegistros

    BEGIN

    DECLARE @CollectedDate DATETIMEOFFSET(7) =
    
        DATEADD(DAY, -(ABS(CONVERT(BIGINT, CHECKSUM(NEWID()))) % 365), SYSDATETIMEOFFSET());
    
    DECLARE @FirstSeenDate DATETIMEOFFSET(7) =
    
        DATEADD(DAY, -(ABS(CONVERT(BIGINT, CHECKSUM(NEWID()))) % 90), @CollectedDate);
    
    DECLARE @LastSeenDate DATETIMEOFFSET(7) =
    
        DATEADD(DAY,
    
            ABS(CONVERT(BIGINT, CHECKSUM(NEWID()))) %
    
            (DATEDIFF(DAY, @FirstSeenDate, @CollectedDate) + 1),
    
            @FirstSeenDate);
    
    INSERT INTO [dbo].[table]
    
    (
    
        [server_name],
    
        [collected_date],
    
        [database_name],
    
        [table_name],
    
        [equality_columns],
    
        [inequality_columns],
    
        [included_columns],
    
        [impact],
    
        [user_seeks],
    
        [query_hash],
    
        [query_plan_hash],
    
        [first_seen_date],
    
        [last_seen_date],
    
        [appearance_count]
    
    )
    
    VALUES
    
    (
    
        N'SQLSERVER-' + CAST(ABS(CHECKSUM(NEWID()) % 10) + 1 AS NVARCHAR(10)),
    
        @CollectedDate,
    
        N'Database_' + CAST(ABS(CHECKSUM(NEWID()) % 20) + 1 AS NVARCHAR(10)),
    
        N'Table_' + CAST(ABS(CHECKSUM(NEWID()) % 100) + 1 AS NVARCHAR(10)),
    
        -- Columnas de igualdad
    
        N'[Column_' + CAST(ABS(CHECKSUM(NEWID()) % 20) + 1 AS NVARCHAR(10)) + N']',
    
        -- Columnas de desigualdad
    
        N'[Column_' + CAST(ABS(CHECKSUM(NEWID()) % 20) + 1 AS NVARCHAR(10)) + N']',
    
        -- Columnas incluidas
    
        N'[Column_' + CAST(ABS(CHECKSUM(NEWID()) % 20) + 1 AS NVARCHAR(10)) +
    
        N'], [Column_' + CAST(ABS(CHECKSUM(NEWID()) % 20) + 1 AS NVARCHAR(10)) + N']',
    
        -- Impacto entre 1 y 100
    
        ABS(CHECKSUM(NEWID()) % 100) + 1,
    
        -- User seeks entre 1 y 100000
    
        ABS(CHECKSUM(NEWID()) % 100000) + 1,
    
        -- Hash de consulta
    
        CONVERT(NVARCHAR(64), NEWID()),
    
        -- Hash del plan
    
        CONVERT(NVARCHAR(64), NEWID()),
    
        @FirstSeenDate,
    
        @LastSeenDate,
    
        -- Número de apariciones entre 1 y 500
    
        ABS(CHECKSUM(NEWID()) % 500) + 1
    
    );
    
    SET @i += 1;
    

    END;

    PRINT CONCAT('Registros insertados: ', @NumRegistros);

    CREATE CLUSTERED INDEX [CCI]

    ON [dbo].[table] ([Id])

    WITH (DROP_EXISTING = ON, DATA_COMPRESSION = PAGE, SORT_IN_TEMPDB = ON)

    ON [PRIMARY];

    GO

    select @@version

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.