|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, May 19, 2009 7:03 AM
Points: 7,
Visits: 66
|
|
Which option uses less log space or writes to the log file the least: 1.rebuild index or 2. dropping an index and then creating it again?
The reason I ask is because I need to rebuild a heavily fragmented index on a SQL 2005 database. We currently have space issues on the drive that the database log file resides on and when we rebuild the index the drive fills up and we are unable to complete the task. At this time, the easy solution of adding more disk space is not an option.
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Today @ 11:20 AM
Points: 31,437,
Visits: 13,752
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, May 19, 2009 7:03 AM
Points: 7,
Visits: 66
|
|
Thanks for the reply Steve.
We have decided to set the Recovery Model of the database to Bulk-logged and then drop and recreate the index. After creating the index we will set the Recovery Model back to Full. The bulk-logged recovery model minimally logs bulk operations, in my case the creation of an index.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 4:39 PM
Points: 6,260,
Visits: 1,977
|
|
shensarling (7/10/2008) Thanks for the reply Steve.
We have decided to set the Recovery Model of the database to Bulk-logged and then drop and recreate the index. After creating the index we will set the Recovery Model back to Full. The bulk-logged recovery model minimally logs bulk operations, in my case the creation of an index.
Make sure you take a full backup or at least a log backup "right after" you switch the recovery mode.
* Noel
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 8:44 AM
Points: 5,204,
Visits: 11,165
|
|
do you mean reorganise vs drop and create rather than rebuild vs drop and create
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, May 19, 2009 7:03 AM
Points: 7,
Visits: 66
|
|
The index was heavily fragmented so I wanted to compare the rebuild vs the drop and create.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 8:44 AM
Points: 5,204,
Visits: 11,165
|
|
oh OK. There are advantages and disadvantages of both, the following link details rebuild vs drop and create
http://msdn.microsoft.com/en-us/library/ms189858.aspx
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|