LATCH_EX

An operation is waiting for exclusive write access to modify a structure in memory. The structure is not related to buffers or transactions, but to some other process within SQL Server.

Latches are lightweight, performance-optimized mechanisms for data consistency within SQL Server. LATCH_* waits protect access to internal memory structures outside the buffer pool pages (non-buffer latches), and their use is determined by the SQL Server engine. The engine uses latch compatibility modes to manage concurrent attempts by multiple threads to acquire latches on the same structures.

On a system with high concurrency, it’s normal for incompatible latch requests to be forced to wait until other requests are complete. If latch contention and wait times affect CPU and throughput, you should investigate. For more information, including details of latch compatibility modes, see: Diagnosing and Resolving Latch Contention on SQL Server (Microsoft Download Center).

Investigating system issues

To determine whether latch contention is a system-wide issue:

  • Check the Analysis page for consistently high values for these metrics:
    • Machine: processor time

    • Avg. CPU queue length

  • Check for SOS_SCHEDULER_YIELD waits in the Top waits table.

Investigating latch contention


Do you have any feedback on this documentation?

Let us know at sqlmonitorfeedback@red-gate.com


Didn't find what you were looking for?