I need to rebuild the clustered index of the table that has more then 1.6 millions rows, more then 20 non-clustered indexes and 80 columns in order to reclaim space after two
NVARCHAR(MAX) columns were deleted.
I have try using the following command:
ALTER INDEX [PK_A] ON [dbo].[B] REBUILD PARTITION = ALL WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) GO
DBCC CLEANTABLE command.
In both cases it takes more then 19 hours. Is there a way to optimize the clustered index rebuild operation?