nerdexam
Microsoft

70-465 · Question #158

Drag and Drop Question You have a database named DB1. DB1 contains a table named Sales.SalesPerson that has an index named AK_SalesPerson_rowguid. Queries that do not use the index take…

The correct answer is REBUILD; ONLINE; ON. Explanation The correct statement being constructed is: ``sql ALTER INDEX AK_SalesPerson_rowguid ON Sales.SalesPerson REBUILD WITH (ONLINE = ON) ` --- Why This Arrangement? The key constraint in the question is: the index must remain usable during defragmentation. That rules…

Submitted by skyler.x· Mar 5, 2026Design and implement database solutions for SQL Server

Question

Drag and Drop Question You have a database named DB1. DB1 contains a table named Sales.SalesPerson that has an index named AK_SalesPerson_rowguid. Queries that do not use the index take approximately 10 times longer to complete than queries that use the index. You discover that AK_SalesPerson_rowguid has severe fragmentation. You need to recommend a solution to defragment the index. The solution must ensure that the index can be used by queries during the defragmentation. What statement should you use? To answer, drag the appropriate elements to the correct locations. Each element may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. Answer:

Exhibit

70-465 question #158 exhibit

Answer Area

Drag items

1GOBLOCKERSFILLFACTOROFFONONLINEREBUILDREORGANIZE

Correct arrangement

  • REBUILD
  • ONLINE
  • ON

Explanation

Explanation

The correct statement being constructed is:

ALTER INDEX AK_SalesPerson_rowguid ON Sales.SalesPerson REBUILD WITH (ONLINE = ON)

Why This Arrangement?

The key constraint in the question is: the index must remain usable during defragmentation. That rules out a simple REBUILD and requires the ONLINE = ON option.


Item-by-Item Breakdown

1. REBUILD

ALTER INDEX supports two defragmentation operations:

  • REORGANIZE - lightweight, always online, but only effective for mild-to-moderate fragmentation
  • REBUILD - drops and recreates the index; more thorough, required for severe fragmentation

Since the question states severe fragmentation, REBUILD is the correct choice. REORGANIZE would be insufficient.

2. ONLINE

This is the option name inside the WITH (...) clause. The full syntax is:

REBUILD WITH (ONLINE = ON)

ONLINE tells SQL Server to allow concurrent user access to the table and index during the rebuild. Without it, an offline rebuild takes a schema modification lock, blocking all queries.

3. ON

This is the value assigned to the ONLINE option. Setting it to ON is what actually enables online operation. Setting it to OFF (the default) would cause the rebuild to block queries - violating the requirement.


Common Mistakes

MistakeWhy it's wrong
Choosing REORGANIZEInsufficient for severe fragmentation; also, it's always online so the ONLINE = ON option doesn't apply to it
Using REBUILD without ONLINE = ONCorrect for defragmenting, but blocks queries - violates the requirement
Setting ONLINE = OFFExplicit offline mode; same blocking problem
Using FILLFACTORControls page fill density on rebuild, not related to online availability
Using BLOCKERSPart of ONLINE = ON (WAIT_AT_LOW_PRIORITY ...) syntax for handling blockers - not required here and not a standalone option

Key Takeaway

The question tests two distinct SQL Server concepts together:

  1. Severity of fragmentation -> determines REBUILD over REORGANIZE
  2. Availability during maintenance -> requires WITH (ONLINE = ON)

Topics

#Index maintenance#Index fragmentation#SQL Server indexes#Online operations

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice