LATCH_EX Occurs when waiting for a EX (exclusive) latch. This does not include buffer latches or transaction mark latches.
According to a SQL Service Waits and Queues, Best Practice Whitepaper:
- Latch_x waits can frequently be reduced by solving LOG and PAGELATCH_UP contention.
- PAGELATCH_UP occurs when a task is waiting for a latch for a buffer that is not in an I/O request. Page latch Update is used only for allocation related pages, and contention on it is frequently a sign that more files are needed. With multiple files, allocations can be distributed across multiple files therefore reducing demand on the per-file data structures stored on these pages. The contention is not IO performance, but internal allocation contention to access the pages. Adding more spindles to a file or moving the file to a faster disk does not help, nor does adding more memory.
- If there is no LOG or PAGELATCH_UP contention, the other option is to partition the table/index in question in order to create multiple caches (the caches are per-index).