SQL Server Query Plans --- Reuse or Recompile?
2016TL; DR
In this seminar, we’ll discuss how SQL Server decides whether to recompile or reuse an existing plan, and how you can tell if that’s a good choice. We’ll also look at how you can ‘encourage’ SQL Server to do what you want it to do.
Session Details
What determines when a plan is reused? When is it better to
recompile? Reusing an inappropriate plan cause a huge reduction in query
response time. On the other hand, recompiling a frequently run query every time
it’s executed can also cause big performance problems.
In this seminar, we’ll discuss how SQL Server decides to recompile
or reuse an existing plan, and how you can tell if that’s a good choice. We’ll
also look at how you can ‘encourage’ SQL Server to do what you want it to do.
The seminar includes extensive demonstrations that illustrate
the details of SQL Server plan caching and recompilation, as well as the
internals of the plan cache and the metadata available for examining its
contents.
This seminar will be presented on SQL Server 2014 and cover
features specific to that version, but most of the information is relevant to
SQL Server 2012 and SQL Server 2008 as well.
3 things you'll get out of this session
Speakers
Kalen Delaney's previous sessions
Behind the Query Store…
Look inside Query Store to see what it does and how it works
Exploring Statistics: Where estimated rowcount comes from
A look inside SQL Server distribution statistics
What Happened? Exploring the Plan Cache
In this session, we'll explore SQL Server's plan cache, including techniques for discovering what plans are in cache, how often they've been run, and whether they contain any sub-optimal operators. Knowing what's happened is the first step in tuning.
Seeking SQL Server Secrets
In this session, I’ll tell you about some of my favorite undocumented features, and also tell you some of my tricks for discovering more undocumented secrets.