sys.dm_os_waiting_tasks
Every request that is submitted to SQL Server is broken down into one or more tasks, depending on whether parallelism is involved. As we mentioned previously, in the Query execution essentials section of Chapter 2, Understanding Query Processing, each task that is involved in processing the query is assigned to a worker thread, and these threads are used to complete the work of the query on the CPUs. Throughout the execution of a query, the various threads will cycle through the running, runnable, and suspended statuses as they process the different operations required to complete the query. When a task needs to wait for a resource, it goes into the suspended state. This is relevant information when troubleshooting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access