LCK_M_SIX is a transaction waiting for a table-wide lock that lets it read the whole table while changing some of it. It is rare, so any amount points at one transaction pattern. Run the check to find that transaction and what it collided with.LCK_M_SIX is a wait to acquire a shared with intent exclusive (SIX) lock. Microsoft’s locking guide describes SIX as protecting shared locks on everything below it in the hierarchy plus intent exclusive locks on some of it: in practice, a transaction that holds a shared lock on the whole table and is also modifying some rows.
Only one SIX lock can exist on a resource at a time, and the only lock compatible with it is intent shared (IS). So the wait means another session holds almost anything at all on the same table.
Is It a Problem?
It is one of the rarer lock waits, so a meaningful amount stands out. It rarely dominates a wait profile on its own; treat it as a clue about one workload rather than a server-wide condition, and judge it over an interval rather than the cumulative totals. The baseline to monitor is close to zero; a non-zero interval is worth a look at what ran during it.
Common Causes
A transaction ends up asking for SIX when it holds a shared lock on the whole table and then modifies rows, or the other way round. These patterns are the commonly reported ones:
- A read with a
TABLOCKorHOLDLOCKhint, followed by an update to the same table inside the same transaction. REPEATABLE READorSERIALIZABLEtransactions whose shared locks escalated to the table, then go on to modify rows.- Two copies of the same batch job running at once, each holding locks the other needs at table level.
The Check To Run
Rank it against everything else with Get Wait Statistics. While it is happening, find the waiter and its blocker with sys.dm_os_waiting_tasks:
SELECT
wt.session_id,
wt.wait_type,
wt.wait_duration_ms,
wt.blocking_session_id,
wt.resource_description,
t.text AS waiting_sql
FROM sys.dm_os_waiting_tasks AS wt
JOIN sys.dm_exec_requests AS r ON r.session_id = wt.session_id
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
WHERE wt.wait_type LIKE N'LCK_M_SIX%'
ORDER BY wt.wait_duration_ms DESC;
Then list the table-level locks with sys.dm_tran_locks to see what the blocker holds and whether the waiter already has a shared lock it is trying to convert:
SELECT
tl.request_session_id,
tl.request_mode,
tl.request_status,
DB_NAME(tl.resource_database_id) AS database_name,
OBJECT_NAME(tl.resource_associated_entity_id, tl.resource_database_id) AS object_name
FROM sys.dm_tran_locks AS tl
WHERE tl.resource_type = N'OBJECT'
AND tl.request_mode <> N'Sch-S'
ORDER BY object_name, tl.request_status, tl.request_session_id;
Run it in the database involved. A WAIT row with mode SIX is the waiter; a GRANT row on the same object from another session is what it is stuck behind. Both queries need VIEW SERVER STATE.
What To Do
- Look at the waiting transaction first. If it reads with
TABLOCKorHOLDLOCKand then updates, drop the hint or split the read from the write. - If it runs under
REPEATABLE READorSERIALIZABLE, check whether that isolation level is needed; underREAD COMMITTEDan ordinary update takes intent exclusive locks, not SIX. - Reduce escalation: index the predicate so the transaction touches fewer rows, or work in smaller batches.
- Run competing copies of the same job one after another, or split them by key range.
The LCK_M Family
Every lock mode has its own wait type, and the name says which lock the waiting session asked for. The check is the same for all of them: find the waiter, then follow blocking_session_id to the head of the chain.
- LCK_M_X / S / URow and page locks. Exclusive, shared and update, the everyday blocking waits, with the full blocking walkthrough.The main lock waits page
- LCK_M_SCH_SSchema stability. Every query needs it, so a queued SCH-M request stalls them all.Worth investigating
- LCK_M_SCH_MSchema modification. DDL waiting for every user of the table to let go.Worth investigating
- LCK_M_ISIntent shared. A reader cannot mark the table because a writer holds the whole of it.Worth investigating
- LCK_M_IXIntent exclusive. A writer cannot mark the table, so modifications stall at table level.Worth investigating
- LCK_M_SIXShared with intent exclusive. A transaction that reads the whole table and changes some of it; rare, so any amount stands out.Worth investigating. This page.
- LCK_M_RS_SRange shared. Serializable reads locking key ranges; check whether that isolation level was chosen.Worth investigating
- LCK_M_RS_URange update. A serializable search for rows it means to update.Worth investigating
- LCK_M_RX_XRange exclusive. Serializable writes locking the gaps between keys, a common deadlock ingredient.Worth investigating
- LCK_M_RIn_NLInsert range. A serializable insert waiting to lock the gap it lands in.Worth investigating
- _LOW_PRIORITYLow priority variants. Index operations and partition switches waiting under WAIT_AT_LOW_PRIORITY.Usually the feature working
Where To Go Next
If LCK_M_SIX is showing up in your wait stats, these are the next places to look.
- LCK_M_X, LCK_M_S, and LCK_M_U, the main lock waits page.
- Troubleshoot SQL Server Blocking, Step by Step, from the first symptom to the head blocker.
- The waits that usually matter, ranked, with what each one is telling you.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply