© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
G. FritcheySQL Server 2022 Query Performance Tuninghttps://doi.org/10.1007/978-1-4842-8891-7_8

8. Query Recompilation

Grant Fritchey1  
(1)
Grafton, MA, USA
 
In order to minimize the overhead from compiling execution plans, the plans are stored in a memory space called the plan cache. When prepared statements, whether as stored procedures or the other mechanisms for creating parameterized queries, are used, the process takes advantage of the plans being in cache. However, a number of things can cause plans to be removed from cache. Sometimes, this is a good thing. Either data has changed, statistics have been updated, or something has happened so a different ...

Get SQL Server 2022 Query Performance Tuning: Troubleshoot and Optimize Query Performance 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.