Skip to content

Commit 92a630a

Browse files
Merge pull request #34626 from dimitri-furman/dfurman/optimized-locking
Add LAQ limitations
2 parents b550fd9 + 5525a06 commit 92a630a

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

docs/relational-databases/performance/optimized-locking.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Learn about the optimized locking enhancement to the database engi
44
author: MikeRayMSFT
55
ms.author: mikeray
66
ms.reviewer: randolphwest, peskount, praspu, dfurman
7-
ms.date: 04/14/2025
7+
ms.date: 07/07/2025
88
ms.service: sql
99
ms.subservice: performance
1010
ms.topic: conceptual
@@ -235,6 +235,19 @@ LAQ is disabled for the database if the percentage of the potentially wasted wor
235235

236236
If the wasted work and the number of restarted statements fall below their respective thresholds, LAQ is re-enabled for the database.
237237

238+
#### LAQ limitations
239+
240+
Lock after qualification might not be used in the following scenarios:
241+
242+
- When disabled by [LAQ heuristics](#laq-heuristics).
243+
- When conflicting locking hints, such as `UPDLOCK`, `READCOMMITTEDLOCK`, `XLOCK`, or `HOLDLOCK` are used.
244+
- When the transaction isolation level is other than `READ COMMITTED`, or when the `READ_COMMITTED_SNAPSHOT` database option is disabled.
245+
- When the table being modified has a columnstore index.
246+
- When the DML statement includes variable assignment.
247+
- When the DML statement has an `OUTPUT` clause.
248+
- When the DML statement uses more than one index seek or scan operator to read the rows being modified.
249+
- In `MERGE` statements.
250+
238251
### <a id="behavior"></a> Query behavior changes with optimized locking and RCSI
239252

240253
Concurrent workloads under read committed snapshot isolation (RCSI) that rely on strict execution order of transactions might experience differences in query behavior when optimized locking is enabled.
@@ -304,7 +317,7 @@ The following improvements help you monitor and troubleshoot blocking and deadlo
304317
- Under each resource in the deadlock report `<resource-list>`, each `<xactlock>` element reports the underlying resources and specific information for locks of each member of a deadlock. For more information and an example, see [Optimized locking and deadlocks](../sql-server-deadlocks-guide.md#optimized-locking-and-deadlocks).
305318
- Extended events
306319
- The `lock_after_qual_stmt_abort` event fires when a statement is internally aborted and restarted because of a conflict with another transaction. For more information, see [Lock after qualification (LAQ)](#lock-after-qualification-laq).
307-
- In [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)], the `locking_stats` event fires for every database every several minutes and provides aggregate locking statistics for the time interval, such as the number of lock escalations, whether TID locking and LAQ components of optimized locking are enabled, and the number of queries that were ineligible for LAQ for various reasons. This event fires even if optimized locking is disabled.
320+
- In [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)], the `locking_stats` event fires for every database every several minutes and provides aggregate locking statistics for the time interval, such as the number of lock escalations, whether TID locking and LAQ components of optimized locking are enabled, and the number of queries where LAQ wasn't used for various reasons. This event fires even if optimized locking is disabled.
308321

309322
## Best practices with optimized locking
310323

0 commit comments

Comments
 (0)