This wait occurs when queries cannot be compiled because SQL Server is waiting for threads to become available. SQL Server caps the amount of queries that can be compiled at once. This wait is often present when the number of Availability Group or database mirrors is excessive. Small values typically do not cause an issue. If values are moderate or high then investigation is required

Resolved by


Suggested solutions

  1. Decrease query complexity
  2. Appropriate indexing could reduce plan complexity
  3. Improve plan reuse (therefore compilation can be avoided)
  4. Increase the number of CPU cores available

Additional research

Thread Usage by Availability Groups

See more

Consider using ApexSQL Monitor, a Windows and SQL Server monitoring tool able to track SQL Server wait types, including the individual query wait statistics

⇐ Back to index