DRAG DROP
You run the following code segment:
After you add 10,000 rows to Customers, you discover that the index is fragmented.
You need to defragment the index in the least amount of time.
Which code segment should you execute?
To answer, drag the appropriate value to the correct location in the code segment in the
answer area. (Answer choices may be used once, more than once, or not at all.)
Explanation:
Note:
Locking the table during the process and not recomputing statistics would be the fastest.
* Online = OFF
Table locks are applied for the duration of the index operation. An offline index operation that
creates, rebuilds, or drops a clustered, spatial, or XML index, or rebuilds or drops a
nonclustered index, acquires a Schema modification (Sch-M) lock on the table. This
prevents all user access to the underlying table for the duration of the operation. An offlineindex operation that creates a nonclustered index acquires a Shared (S) lock on the table.
This prevents updates to the underlying table but allows read operations, such as SELECT
statements.
* STATISTICS_NORECOMPUTE = ON
Out-of-date statistics are not automatically recomputed.
Reference: ALTER INDEX (Transact-SQL)