Skip to content

Commit 52cb4f5

Browse files
20230313 1622
1 parent c3a8193 commit 52cb4f5

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

azure-sql/database/analyze-prevent-deadlocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ There are multiple techniques available to prevent deadlocks from reoccurring, i
773773
- Breaking apart transactions into smaller transactions when possible.
774774
- Using query hints, if necessary, to optimize performance. You can apply hints without changing application code [using Query Store](/sql/relational-databases/performance/query-store-hints?view=azuresqldb-current&preserve-view=true).
775775

776-
Find more ways to [minimize deadlocks in the Deadlocks guide](/sql/relational-databases/sql-server-deadlocks-guide#deadlock_minimizing).
776+
Find more ways to [minimize deadlocks in the Deadlocks guide](/sql/relational-databases/sql-server-deadlocks-guide#minimize_deadlocks).
777777

778778
> [!NOTE]
779779
> In some cases, you may wish to [adjust the deadlock priority](/sql/t-sql/statements/set-deadlock-priority-transact-sql) of one or more sessions involved in a deadlock if it is important for one of the sessions to complete successfully without retrying, or when one of the queries involved in the deadlock is not critical and should be always chosen as the victim. While this does not prevent the deadlock from reoccurring, it may reduce the impact of future deadlocks.

docs/relational-databases/sql-server-deadlocks-guide.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -364,22 +364,22 @@ Implementing an error handler that traps error message 1205 allows an applicatio
364364

365365
The application should pause briefly before resubmitting its query. This gives the other transaction involved in the deadlock a chance to complete and release its locks that formed part of the deadlock cycle. This minimizes the likelihood of the deadlock reoccurring when the resubmitted query requests its locks.
366366

367-
## <a id="deadlock_minimizing"></a> Minimize deadlocks
367+
## Minimize deadlocks
368368

369369
Although deadlocks cannot be completely avoided, following certain coding conventions can minimize the chance of generating a deadlock. Minimizing deadlocks can increase transaction throughput and reduce system overhead because fewer transactions are:
370370

371-
- Rolled back, undoing all the work performed by the transaction.
372-
- Resubmitted by applications because they were rolled back when deadlocked.
371+
- Rolled back, undoing all the work performed by the transaction.
372+
- Resubmitted by applications because they were rolled back when deadlocked.
373373

374374
To help minimize deadlocks:
375375

376-
- Access objects in the same order.
377-
- Avoid user interaction in transactions. - Keep transactions short and in one batch.
378-
- Use a lower isolation level.
379-
- Use a row versioning-based isolation level.
380-
- Set `READ_COMMITTED_SNAPSHOT` database option on to enable read-committed transactions to use row versioning.
381-
- Use snapshot isolation.
382-
- Use bound connections.
376+
- Access objects in the same order.
377+
- Avoid user interaction in transactions. - Keep transactions short and in one batch.
378+
- Use a lower isolation level.
379+
- Use a row versioning-based isolation level.
380+
- Set `READ_COMMITTED_SNAPSHOT` database option on to enable read-committed transactions to use row versioning.
381+
- Use snapshot isolation.
382+
- Use bound connections.
383383

384384
### Access objects in the same order
385385

docs/relational-databases/sql-server-transaction-locking-and-row-versioning-guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ The only lock taken that references `HumanResources.Employee` is a schema stabil
16401640
16411641
In [!INCLUDE [ssnoversion-md](../includes/ssnoversion-md.md)], the `LOCK_ESCALATION` option of `ALTER TABLE` can disfavor table locks, and enable HoBT locks on partitioned tables. This option is not a locking hint, but can be used to reduce lock escalation. For more information, see [ALTER TABLE (Transact-SQL)](../t-sql/statements/alter-table-transact-sql.md).
16421642
1643-
### <a id="Customize"></a> Customize locking for an index
1643+
### Customize locking for an index
16441644
16451645
When optimized locking is enabled, [!INCLUDE[ssDEnoversion](../includes/ssdenoversion-md.md)] does not keep low-level locks for the duration of a transaction. There is no need to customize locking strategies for an index or to disable low-level locks.
16461646
@@ -1826,7 +1826,7 @@ You may have to use the KILL statement. Use this statement very carefully, howev
18261826
Deadlocks are a complex topic related to locking, but different from blocking.
18271827

18281828
- For more information on deadlocks, including monitoring, diagnosis, and samples, see the [Deadlocks guide for the SQL Server database engine](sql-server-deadlocks-guide.md).
1829-
- For more information on deadlocks specific to Azure SQL Database, see [Analyze and prevent deadlocks in Azure SQL Database](../../azure-sql/database/analyze-prevent-deadlocks.md).
1829+
- For more information on deadlocks specific to Azure SQL Database, see [Analyze and prevent deadlocks in Azure SQL Database](/azure/azure-sql/database/analyze-prevent-deadlocks).
18301830

18311831
## <a id="Additional_Reading"></a> See also
18321832

@@ -1839,4 +1839,4 @@ Deadlocks are a complex topic related to locking, but different from blocking.
18391839
## Next steps
18401840

18411841
- [Understand and resolve SQL Server blocking problems](/troubleshoot/sql/database-engine/performance/understand-resolve-blocking)
1842-
- [Understand and resolve Azure SQL Database blocking problems](../../azure-sql/database/understand-resolve-blocking.md)
1842+
- [Understand and resolve Azure SQL Database blocking problems](/azure/azure-sql/database/understand-resolve-blocking)

0 commit comments

Comments
 (0)