~/talk

Here’s the execution plan … now what?

Talkat SQLBits 2022 · 2022-03-08..03-12· [databases]
links:none on file
slides:none on file

Diagnoses a dashboard causing resource semaphore waits by reading actual execution plans and estimated operator input, finds a 120,000-row sort feeding a temp table that grants 47 MB to 14 MB of memory after replacing the insert+sort with a top-end sort for page 1 (999 of 1000 calls are page one), accepts a small correctness risk to remove spills. For erratic runs uses Query Store to prove parameter sniffing, then splits logic and uses safe parameterized dynamic SQL or OPTION(RECOMPILE) to get stable plans.

AI-written summary · about

  1. 0:00Introduction
  2. 1:34Theory versus execution plans
  3. 4:47Resource semaphor waits in SQL Server
  4. 8:47Paginated sales report analysis
  5. 12:20Memory-heavy operators in plans
  6. 16:21Optimizing memory grants for dashboards
  7. 27:29Bug in optimized query
  8. 29:15Erratic query performance patterns
  9. 32:06Query Store for performance issues
  10. 38:29Bad parameter sniffing causes
  11. 43:06Fixing bad parameter sniffing
  12. 47:42Dynamic SQL to avoid sniffing
  13. 50:13Balancing optimization and business
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.