~/talk

Here’s the execution plan … now what?

Talkat SQLBits 2024 · 2024-03-19..03-23· [databases]
links:none on file
slides:none on file

Examines real plans to find the exact culprit: a dashboard paginated_sales_report uses a temp table and a full Sort that requests ~47 MB per execution, multiplying into RESOURCE_SEMAPHORE waits when ~999 of 1000 calls request page 1; rewriting page 1 to use TOP 20 (no temp table) forces a top-end sort and drops the grant to ~14 MB (fixing the semaphore problem). Uses execution plans, Query Store and plan properties (memory grant, estimated rows, hash vs sort) and shows optional-parameter fixes: split procedures, safe Dynamic SQL or OPTION(RECOMPILE).

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.