~/talk

T-SQL Window Function Performance

Talkat Women Data Summit 2021 · on Saturday, 2021-06-26· [databases]
slides:none on file

Shows concrete fixes: adding a covering POC index cuts table logical reads (example scan drops from 689 to 119), using explicit frame ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW forces in‑memory work tables and drives logical reads to zero for running totals and FIRST_VALUE, and enabling batch mode on rowstore in SQL Server 2019 turns expensive table spools into window aggregate operators. Measured impact: a 30M-row workload falls from ~36 minutes with the default RANGE frame to ~3.5 minutes with ROWS (and additional gains when pre-aggregating).

AI-written summary · about

  1. 0:00Introduction
  2. 1:57Demo
  3. 7:13Results
  4. 7:55Adding an Index
  5. 12:35Review
  6. 13:10Frame
  7. 14:24Terminology
  8. 17:37Examples
  9. 21:38Range
  10. 28:47Recap
  11. 29:59Batch Mode
  12. 41:10Timings
~/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.