get_wait_stats
Aggregate query wait time by wait category to identify why SQL Server queries are slow (CPU, blocking, IO, memory), ranked by total wait time.
Instructions
Aggregate query wait time by wait category over a time window — shows WHY queries are slow (CPU, blocking/locks, IO, memory, etc.) rather than which are slow. Ranked by total wait time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_n | No | Max wait categories to return. | |
| recent_hours | No | Lookback window in hours. | |
| database_name | Yes | Target SQL Server database name. |