When is a plan not able to be reused?
This is the final in a series of posts about query plans. The third entry explained how the plans are stored in a cache to be reused. This post will cover the opposite. When are plans NOT able to be reused? What would cause a plan to need to be compiled again? There are several reasons that a query plan would need to be compiled again, but they can be boiled down to a few popular reasons. The first one is simple. The plan cache is stored exclusively in memory. If there is memory pressure on the instance SQL Server will eject plans from cacheRead More →