| title | SQL Server, Latches object | ||
|---|---|---|---|
| description | Learn about the SQLServer:Latches object, which provides counters to monitor internal SQL Server resource locks called latches. | ||
| author | MikeRayMSFT | ||
| ms.author | mikeray | ||
| ms.date | 12/04/2023 | ||
| ms.service | sql | ||
| ms.subservice | performance | ||
| ms.topic | reference | ||
| helpviewer_keywords |
|
[!INCLUDE SQL Server]
The SQLServer:Latches object in Microsoft [!INCLUDE ssNoVersion] provides counters to monitor internal [!INCLUDE ssNoVersion] resource locks called latches. Monitoring the latches to determine user activity and resource usage can help you to identify performance bottlenecks.
This table describes the [!INCLUDE ssNoVersion] Latches counters.
| SQL Server Latches counters | Description |
|---|---|
| Average Latch Wait Time (ms) | Average latch wait time (in milliseconds) for latch requests that had to wait. |
| Average Latch Wait Time Base | For internal use only. |
| Latch Waits/sec | Number of latch requests that could not be granted immediately. |
| Number of SuperLatches | Number of latches that are currently SuperLatches. |
| SuperLatch Demotions/sec | Number of SuperLatches that have been demoted to regular latches in the last second. |
| SuperLatch Promotions/sec | Number of latches that have been promoted to SuperLatches in the last second. |
| Total Latch Wait Time (ms) | Total latch wait time (in milliseconds) for latch requests in the last second. |
You begin to explore the query performance counters in this object using this T-SQL query on the sys.dm_os_performance_counters dynamic management view:
SELECT * FROM sys.dm_os_performance_counters
WHERE object_name LIKE '%Latches%';