A wait stats collection script saves snapshots of sys.dm_os_wait_stats into a table, so you can compare two snapshots instead of reading totals since the last restart. This post builds the tables and a snapshot procedure, creates a small load, and reports the change with a category for each wait. It also covers idle waits, restarts and retention.
SQL SERVER – Get Wait Stats Related to Specific Session ID With sys.dm_exec_session_wait_stats
From SQL Server 2016, sys.dm_exec_session_wait_stats shows wait stats for a specific session ID. Here is how to use it, and why it fails on older versions.
SQL SERVER – 3 Different Usage of DBCC SQLPERF
DBCC SQLPERF can report log usage or reset cumulative wait and latch statistics. I separate reporting from resetting the baseline.
SQL SERVER – Queries are in KILLED/ROLLBACK State with Wait PREEMPTIVE_OLEDB_RELEASE
After a network outage, queries stayed in KILLED/ROLLBACK with the undocumented wait PREEMPTIVE_OLEDB_RELEASE. What I saw and how to clear them.
Resource Bottlenecks in SQL Server: A Wait Stats Script That Groups Them
Resource bottlenecks hide in the wait statistics, under a pile of idle waits and totals since startup. This post builds a script that removes the idle waits, measures an interval and groups the rest by resource. It also explains how to read each group and the signal wait.
SQL SERVER – Finding Waits For Any Session with Extended Event wait_info
It becomes a great win-win situation. Let us learn about Extended Event wait_info in this blog post. Do you think this script will be useful for you?






