Share via

Database deployment is wiping off the plan cache

Babji Talluri 26 Reputation points
2022-06-07T06:21:49.71+00:00

Database deployment is flushing all the cached execution plans and causing slowness and performance issues in the application until its built up again. Trying to find options to retain the cache as-is or warm up the cache through some kind of job. Any recommendations will be appreciated,Thank you in advance!

Azure SQL Database
0 comments No comments

Answer accepted by question author

Alberto Morillo 35,506 Reputation points MVP Volunteer Moderator
2022-06-07T11:17:00.22+00:00

If your deployments make changes to a table or view (ALTER TABLE and ALTER VIEW) referenced by queries/stored procedures/functions then all plans related to those tables or views will be removed from the cache.

In addition, on Azure SQL the procedure plan cache is optimized for the benefit of the machine and not for an individual database. That means we have very little control over the procedure cache on an specific Azure SQL database, as the procedure cache is managed as a whole and there is no a portion of the memory pool set aside for each database. SQL Azure removes plans from the cache, regardless of the plan owner; all plans across all databases existing on the server are evaluated for removal.

My suggestion, at the end of your deployment you can a run a SQL Task to run a group of your top most commonly used stored procedures.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.