Chapter 12. Plan caching and recompilation

Kalen Delaney

We’ve looked at the query optimization process and the details of query execution in Microsoft SQL Server. Because query optimization can be complex and time-consuming, SQL Server frequently and beneficially reuses plans that have already been generated and saved in the plan cache, rather than produce a completely new plan. However, in some cases, using a previously created plan might not be ideal for the current query execution, and creating a new plan might result in better performance.

This chapter looks at the SQL Server 2012 plan cache and how it’s organized. Most discussion is relevant to SQL Server 2005 and later versions as well, and I will tell you when a behavior or feature was introduced ...

Get Microsoft SQL Server 2012 Internals now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.