Search code examples
sqlsql-serversql-server-2008full-text-indexingnon-clustered-index

Does dropping of non clustered index removes existing Full Text Indexing in SQL Server table?


CREATE TABLE [dbo].[TicketTasks]
(
        [TicketTaskId] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
        [TicketTaskTypeId] [char](2) NOT NULL,
        [TicketId] [int] NOT NULL, 
        [CreatedUtc] [datetime] NOT NULL,
        [DeletedUtc] [datetime] NULL,
        [DepartmentId] [int] NOT NULL,
        [TaskAction] [nvarchar](max) NULL,
        [TaskResult] [nvarchar](max) NULL,
        [TaskPrivateNote] [nvarchar](max) NULL,

        CONSTRAINT [PK_TicketTasks] 
           PRIMARY KEY CLUSTERED ([TicketTaskId] ASC) 
)

HI this is my table structure.

  1. TicketTaskId which is clustered
  2. TicketId non clustered index with [CreatedUtc], [DeletedUtc], [DepartmentId]
  3. TaskAction, TaskResult, TaskPrivateNote is Added for full text indexing

I have around 50 million records in this table. Currently I have to drop and recreate non clustered index for TicketID to sort in desc.

Does this dropping of non clustered index affect any other indexes?

Will it remove the full text indexing done for the table?


Solution

  • Common non-clustered indexes are independent of each other, the only problem you might get will be if you tamper with the clustered one (usually accompanied by a PRIMARY KEY), since it physically reorganizes the data and all other indexes contain a pointer to it.

    However, full text indexes are attached to an index that enforces uniqueness of values (a UNIQUE index). This is done by the KEY INDEX option when creating the full text index:

    CREATE FULLTEXT INDEX 
        ON [dbo].[TicketTasks](TaskAction)   
        KEY INDEX <UniqueIndexName>
    

    So as long as you don't change this referenced unique index, you can drop the other non-clustered indexes.