Chapter 9. Plan Caching and Recompilation

Kalen Delaney

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

In this chapter, we look at the SQL Server 2008 plan cache and how it is organized. Most of the discussion is relevant to SQL Server 2005 as well, and I will tell you when a behavior or feature ...

Get Microsoft® SQL Server® 2008 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.