Skip to content

About locking with REORGANIZE #4011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/t-sql/statements/alter-index-transact-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,14 @@ PARTITION
REORGANIZE a **rowstore** index
For rowstore indexes, REORGANIZE specifies to reorganize the index leaf level. The REORGANIZE operation is:

- Always performed online. This means long-term blocking table locks are not held and queries or updates to the underlying table can continue during the ALTER INDEX REORGANIZE transaction.
- Always performed online. This means long-term blocking table locks are not held and queries or updates to the underlying table can continue during the ALTER INDEX REORGANIZE transaction.
- Not allowed for a disabled index
- Not allowed when ALLOW_PAGE_LOCKS is set to OFF
- Not rolled back when it is performed within a transaction and the transaction is rolled back.

> [!NOTE]
> If using explicit transactions instead of the default implicit transaction mode (e.g., ALTER INDEX within BEGIN TRAN ... COMMIT/ROLLBACK), the locking behavior of REORGANIZE becomes more restrictive. For more information on implicit transactions, see [SET IMPLICIT_TRANSACTIONS (Transact-SQL)](../../t-sql/statements/set-implicit-transactions-transact-sql.md)

For more information, see [Reorganize and Rebuild Indexes](../../relational-databases/indexes/reorganize-and-rebuild-indexes.md).

REORGANIZE WITH **(** LOB_COMPACTION = { **ON** | OFF } **)**
Expand Down