Assume that you enable Automatic Query Tuning in SQL Server 2017. When executing many concurrent stored procedures, you may encounter COMPILE blocking scenario under the following conditions:
- Execute the stored procedure.
- Use Query Data Store (QDS) to force the plan.
- Run sp_recompile on the stored procedure to forcibly remove the plan from procedure cache.
- Run the stored procedure concurrently on many separate sessions.
After forcing a plan by using Query Data Store and removing it from the procedure cache, the plan is no longer cached and concurrent execution results in compile blocking.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
This issue is fixed in the following cumulative update for SQL Server:
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server: