The query optimization process is expensive. Because of this, SQL Server keeps the execution plans it has created in memory in order to reuse those plans. The space where these plans are stored is referred to as the plan cache. Understanding how plans get into, and out of, the plan cache is an important part of query tuning. In this chapter, I will walk you through the mechanisms you can use to monitor and observe the plan cache and plan reuse.
Querying the plan ...