Question : SQL 2005 Rebuild Index Keep Index Online Option

I am re-vamping our database optimization jobs.  I have a question about the "Keep index Online" option for the Rebuild Index task.   When I enable this option, and execute the maintenance plan, it runs forever and then errors out (see error below).   What is the impact of not using this option while users are still in the system?  Even if the plan runs successfully, it takes a very long time, 1 hour vs, 8 minutes not enabled.
Code Snippet:
1:
2:
Executing the query "ALTER INDEX [PK_cde_attachment_bits__attach_id] ON [dbo].[cde_attachment_bits] REBUILD WITH ( PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, SORT_IN_TEMPDB = ON, ONLINE = ON )
" failed with the following error: "Online index operation cannot be performed for index 'PK_cde_attachment_bits__attach_id' because the index contains column 'attach_bits' of data type text, ntext, image, varchar(max), nvarchar(max), varbinary(max) or xml. For non-clustered index the column could be an include column of the index, for clustered index it could be any column of the table. In case of drop_existing the column could be part of new or old index. The operation must be performed offline.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly
Open in New Window Select All

Answer : SQL 2005 Rebuild Index Keep Index Online Option

Because when you run it online, it has to create a version store of the index so it can stay online and be used....which takes a LOT of extra overhead.  If you just run the reindex w/o it being online, it is going to be faster.  BUT, in doing this, it will lock the table for which you're reindexing....that is why they made the online option available in 2005.  Make more sense now?  sorry I wasn't very clear before.
Random Solutions  
 
programming4us programming4us