© Edward Pollack 2019
Edward PollackDynamic SQLhttps://doi.org/10.1007/978-1-4842-4318-3_8

8. Parameter Sniffing

Edward Pollack1 
(1)
Albany, NY, USA
 

In Chapter 6 we introduced a number of tools, methods, and tips for performance optimization. A critical component that was briefly discussed was the query plan cache. Whenever a query is executed for the first time, an execution plan is generated by the query optimizer. This process is expensive, and therefore it is beneficial to minimize the work that is performed by it. Execution plans are placed into the query plan cache when optimization is complete, where they will remain until sufficient changes occur in execution, available memory, or the underlying data to push that plan out of cache.

This process ...

Get Dynamic SQL: Applications, Performance, and Security in Microsoft SQL Server 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.