Which code segment should you execute?

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.)
Select and Place:

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.)
Select and Place:

Answer:

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 offline index 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.
ALTER INDEX (Transact-SQL)



Leave a Reply 0

Your email address will not be published. Required fields are marked *