~/talk

Dealing with Very Large Tables in SQL Server

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

Shows a real 20 billion–row / 4.6 TB table that takes 28 minutes and ~72 million logical reads to return 3 rows when missing an index, so adding indexes must be planned (Enterprise resumable index builds suggested) and rebuilding everything is dangerous. Default sampling causes huge cardinality errors (examples: 44x–130x overestimation); fix by using persist_sample_percent (aim ≥5%), update with NORECOMPUTE, enable AUTO_UPDATE_STATISTICS_ASYNC for large DBs, prefer filtered stats/columnstore tricks, and use ALTER TABLE ... SWITCH to remove identity without copying data when foreign keys allow.

AI-written summary · about

  1. 0:00Large tables in SQL Server
  2. 1:09Defining very large tables
  3. 3:57Challenges with large tables
  4. 7:28Missing indexes cost
  5. 9:57Query writing impact
  6. 14:10Cardinality estimation issues
  7. 24:33Fixing cardinality issues
  8. 28:44Auto update stats async
  9. 35:38Auto create stats risks
  10. 39:13Querying log tables
  11. 42:31Ascending key problem
  12. 46:18Identity column changes
  13. 50:33Q&A
~/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.