Dealing with Very Large Tables in SQL Server
summary
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
chapters (13)
- 0:00Large tables in SQL Server
- 1:09Defining very large tables
- 3:57Challenges with large tables
- 7:28Missing indexes cost
- 9:57Query writing impact
- 14:10Cardinality estimation issues
- 24:33Fixing cardinality issues
- 28:44Auto update stats async
- 35:38Auto create stats risks
- 39:13Querying log tables
- 42:31Ascending key problem
- 46:18Identity column changes
- 50:33Q&A
related talks
51mDealing with Very Large Tables in SQL Server
51mDealing with Very Large Tables in SQL Server
50mKeeping historical data in tables forever – mission (im)possible!
54mLessons learned from refactoring multi terabyte databases for the last 10 years
53mIndexing Internals for Developers & DBAs
53mWhen to stop tuning a query
53mIndexing Internals for Developers & DBAs
54mLessons learned from refactoring multi terabyte databases for the last 10 years
