Information About Waits Stats in SQL Server SQLCLR and Trace Related Waits


SQL Server internally uses worker threads to execute SQL queries sent by various applications. While threads are executing they may be either running on CPU processing the request or would be waiting on a certain resource or waiting in waiting for its chance to run on CPU. SQL Server assigns a certain wait type to the worker thread that is waiting.

If a query is taking long time to complete, we can look at the query sessions wait type to get an understanding of what kind of resource it is the query waiting for and take appropriate action to avoid the queries to wait, thus making the queries complete fast.

Below are some of the SQL Server Wait Types related to SQLCLR related waits, SQL Server SORT related waits, SQL Server Trace related waits, SQL Server TempDB and Log waits.

Occurs while CLR waits for an application domain to complete startup.

Occurs while waiting for access to the loaded assembly list in the appdomain.

Occurs while CLR waits for deadlock detection to complete.

Occurs when a CLR task is throttled because it has exceeded its execution quantum. This throttling is done in order to reduce the effect of this resource-intensive task on other tasks.

Occurs during internal synchronization, while initializing internal sorting structures.

Occurs during internal synchronization, while initializing internal sorting structures.

Occurs when a task is waiting for a background task to flush trace buffers to disk every four seconds.

Occurs during synchronization on trace buffers during a file trace.

Occurs while trace shutdown waits for outstanding trace events to complete.

Occurs while a SQL Trace event queue waits for packets to arrive on the queue.

Occurs while the shutdown process waits for internal resources to be released to shutdown cleanly.

Occurs when temporary object drops are synchronized. This wait is rare, and only occurs if a task has requested exclusive access for temp table drops.

Occurs when a task is waiting for a worker to run on. This can indicate that the maximum worker setting is too low, or that batch executions are taking unusually long, thus reducing the number of workers available to satisfy other batches.

Occurs during internal synchronization of the Extended Events timer.

Occurs when the SQL Trace rowset trace provider waits for either a free buffer or a buffer with events to process.

This is applicable on below versions of SQL Server

SQL Server 2005
SQL Server 2008 R2
SQL Server 2012
SQL Server 2014

Hope this was helpful.

SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, SQL Server Frequently asked questions, SQL Server Trainings.


Leave a Reply

Your email address will not be published. Required fields are marked *