TABLE 1: Comparison of Defragmentation Methods
Command Data Availability Speed Simplicity Log Impact Statistics Additional Space Required in Filegroup
DBCC DB-REINDEX Lowest: Data is offline for the duration of the command. Fastest: Faster than individual INDEX DROP/CREATE statements. DBCC DBRE-INDEX can take advantage of more optimizations than individual DROP INDEX and CREATE INDEX statements can. High: Can rebuild all indexes automatically and atomically; however, all your indexes must be fragmented. High, but can be reduced by using Bulk-Logged recovery model. Updated Highest: All data sorted in data filegroup.
DBCC INDEX-DEFRAG High: Data is not locked for long periods. Slowest for heavily fragmented objects, but you can stop and start the command at will. Low: You must specify individual indexes. Low: Log can be backed up while the command is active. Not updated Lowest: Operates at the data-page level.
CREATE INDEX...DROP_EXISTING Medium: Data unavailable only while the command is operating on clustered index. Medium: Can avoid a sort and also just recreate defragmented indexes, but each each non-clustered index rebuild will scan the data. Low: You must specify individual indexes and use transaction semantics to make the process atomic. High, but can be reduced by using Bulk-Logged recovery model. Updated Medium: SORT_IN_TEMPDB option uses tempdb for intermediate sorting.