Plan Caching in SQL Server v1

Plan Caching in SQL Server v1

Kendra Little | March 4, 2024

I drew out a first visualization of how the shared plan cache in SQL Server is used when you run a query. When SQL Server executes a query, it creates an execution plan and stores it in the plan cache for reuse. This caching mechanism helps performance by avoiding the overhead of recompiling similar queries, but it can also lead to plan reuse problems when the cached plan isn’t optimal for new parameter values.

I’m pretty sure I’ll refine and and elaborate on this in the future, so let’s call this the v1.