Thor Logo dbatools

Waits

Clear-DbaLatchStatistics

Patrick Flynn (@sqllensman)

Clear-DbaLatchStatistics View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Resets SQL Server latch statistics counters to establish a fresh performance baseline Description Clears all accumulated latch statistics from the sys.dm_os_latch_stats dynamic management view by executing DBCC SQLPERF (N’sys.dm_os_latch_stats’, CLEAR). This resets counters for latch types like BUFFER, ACCESS_METHODS_DATASET_PARENT, and others to zero values. Use this when troubleshooting latch contention to get a clean baseline before running your workload, or during performance testing to measure the impact of specific queries or operations.

Read more

Clear-DbaWaitStatistics

Chrissy LeMaire (@cl)

Clear-DbaWaitStatistics View Source Chrissy LeMaire (@cl) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Resets SQL Server wait statistics to establish a clean monitoring baseline Description Clears all accumulated wait statistics from sys.dm_os_wait_stats by executing DBCC SQLPERF (N’sys.dm_os_wait_stats’, CLEAR). This is essential for performance troubleshooting when you need to establish a new baseline for wait analysis. DBAs commonly clear wait stats after resolving performance issues, during maintenance windows, or when beginning focused monitoring periods to isolate specific workload patterns without historical noise.

Read more

Get-DbaLatchStatistic

Patrick Flynn (@sqllensman)

Get-DbaLatchStatistic View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Retrieves latch contention statistics from SQL Server to identify performance bottlenecks Description Analyzes latch wait statistics from sys.dm_os_latch_stats to help identify latch contention issues that may be causing performance problems. This function implements Paul Randal’s methodology for latch troubleshooting by returning the most significant latch classes based on cumulative wait time percentage.

Read more

Get-DbaSpinLockStatistic

Patrick Flynn (@sqllensman)

Get-DbaSpinLockStatistic View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Retrieves spinlock contention statistics from SQL Server’s internal synchronization mechanisms Description Queries sys.dm_os_spinlock_stats to return detailed statistics about SQL Server’s spinlock usage and contention. Spinlocks are lightweight synchronization primitives that SQL Server uses internally for very brief waits when protecting critical code sections and memory structures.

Read more

Get-DbaWaitingTask

Shawn Melton (@wsmelton), wsmelton.github.io

Get-DbaWaitingTask View Source Shawn Melton (@wsmelton), wsmelton.github.io Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Retrieves detailed information about currently waiting sessions and their wait types from SQL Server dynamic management views. Description Queries sys.dm_os_waiting_tasks and related DMVs to identify sessions that are currently waiting, along with comprehensive diagnostic information including wait types, durations, blocking sessions, SQL text, and query plans.

Read more

Get-DbaWaitStatistic

Chrissy LeMaire (@cl), netnerds.net

Get-DbaWaitStatistic View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Retrieves SQL Server wait statistics for performance analysis and troubleshooting Description Analyzes SQL Server wait statistics from sys.dm_os_wait_stats to identify performance bottlenecks and resource contention issues. This function categorizes wait types, calculates timing metrics and percentages, and provides diagnostic explanations based on Paul Randal’s methodology.

Read more