Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 4c0b8a2

Browse files
committed
Update per request.
1 parent d011f49 commit 4c0b8a2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

docs/relational-databases/indexes/how-online-index-operations-work.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversio
5959
|Build<br /><br /> Main phase|The data is scanned, sorted, merged, and inserted into the target in bulk load operations.<br /><br /> Concurrent user select, insert, update, and delete operations are applied to both the pre-existing indexes and any new indexes being built.|IS<br /><br /> INDEX_BUILD_INTERNAL_RESOURCE**|
6060
|Final<br /><br /> Short phase|All uncommitted update transactions must complete before this phase starts. Depending on the acquired lock, all new user read or write transactions are blocked for a short period until this phase is completed.<br /><br /> System metadata is updated to replace the source with the target.<br /><br /> The source is dropped if it is required. For example, after rebuilding or dropping a clustered index.|INDEX_BUILD_INTERNAL_RESOURCE**<br /><br /> S on the table if creating a nonclustered index.\*<br /><br /> SCH-M (Schema Modification) if any source structure (index or table) is dropped.\*|
6161

62-
\* The index operation waits for any uncommitted update transactions to complete before acquiring the S lock or SCH-M lock on the table.
62+
\* The index operation waits for any uncommitted update transactions to complete before acquiring the S lock or SCH-M lock on the table. If a long running query is taking place, the online index operation waits until the query has finished.
6363

6464
** The resource lock INDEX_BUILD_INTERNAL_RESOURCE prevents the execution of concurrent data definition language (DDL) operations on the source and pre-existing structures while the index operation is in progress. For example, this lock prevents concurrent rebuild of two indexes on the same table. Although this resource lock is associated with the Sch-M lock, it does not prevent data manipulation statements.
6565

6666
The previous table shows a single Shared (S) lock acquired during the build phase of an online index operation that involves a single index. When clustered and nonclustered indexes are built, or rebuilt, in a single online index operation (for example, during the initial clustered index creation on a table that contains one or more nonclustered indexes) two short-term S locks are acquired during the build phase followed by long-term Intent Shared (IS) locks. One S lock is acquired first for the clustered index creation and when creating the clustered index is completed, a second short-term S lock is acquired for creating the nonclustered indexes. After the nonclustered indexes are created, the S lock is downgraded to an IS lock until the final phase of the online index operation.
67-
67+
68+
For more information about how locks are used and how you can manage them, see [Arguments](../../t-sql/statements/alter-table-index-option-transact-sql.md#arguments).
69+
6870
### Target Structure Activities
6971
The following table lists the activities that involve the target structure during each phase of the index operation and the corresponding locking strategy.
7072

@@ -85,4 +87,6 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversio
8587

8688
[Guidelines for Online Index Operations](../../relational-databases/indexes/guidelines-for-online-index-operations.md)
8789

88-
90+
## Next steps
91+
92+
[ALTER TABLE index options](../../t-sql/statements/alter-table-index-option-transact-sql.md#arguments)

0 commit comments

Comments
 (0)