Louis Tochon wants to know if optimized locking actually ran:
In the first case, SQL Server escalated the row locks to an
Xlock on the whole table. In the second, there is no escalation anymore, only oneXlock on the transaction ID (XACT), next to the intent lock (IX) on the table (theISlock in both results is on the small function I used to run this query).That is nice in a demo, but on a real server nobody is looking at
sys.dm_tran_locksat the right moment. I wanted to know how a DBA can check what optimized locking does once it is enabled. SQL Server 2025 has a few Extended Events for that, and I found some of their fields easy to misread and one of them reports LAQ as enabled on a database where it never ran once.
Click through to learn more.