Skip to main content
4 of 4
added details from comments by the OP
Hannah Vernon
  • 70.5k
  • 22
  • 177
  • 321

How to regenerate execution plans after clearing the plan cache?

After clearing the plan cache on SQL Server, how do I regenerate execution plans for stored procedures without executing the stored procedures themselves?

When I updated statistics this morning, one of my stored procedures was running really sluggishly. Per some google-fu, I found that clearing the plan cache can fix the issue - and it did. However, if I have to do this again, I'd like to avoid the performance hit from regenerating the plans while a user is waiting for a response.

Version/edition of SQL Server is 2016 Enterprise.