dataiotech Labs
dbaguidedbaguideDBAdataxtoolsdataopsphere
Home/Glossary/Latch vs Enqueue
Latch vs EnqueuePerformance & Recovery

Latch vs. Enqueue (Bellek Kilidi vs. Nesne Kilidi)

Latches are low-level short-duration spin locks protecting shared memory structures; Enqueues are sophisticated queuing locks protecting logical database objects and transactions.

Internal Architecture Breakdown

Latches operate in memory as atomic spin locks designed to serialize access to internal SGA data structures with minimal context switching overhead.

Enqueues (such as TX transaction locks and TM DDL locks) support shared, exclusive, and row-exclusive modes with ordered queues and deadlock detection. Latch bottlenecks saturate CPU cores, whereas enqueue waits surface as application locking and blocking cascades.

Production Inspection Queries

Oracle
SELECT name, gets, misses, spin_gets, sleeps FROM v$latch WHERE misses > 0 ORDER BY sleeps DESC;
SELECT type, id1, id2, lmode, request, ctime, block FROM v$lock WHERE block > 0 OR request > 0;