Explaining SQL Server Statistics with Playing Cards
When you run a query, how does SQL Server estimate the number of rows? I’ll explain in this half-hour video demo using playing cards, then showing the same issues in SQL Server Management Studio:
Here’s the demo script I use in the video.
To learn more, check out our free statistics class on YouTube.
Related

Hi! I’m Brent Ozar.
I make Microsoft SQL Server go faster. I love teaching, travel, cars, and laughing. I’m based out of Las Vegas. He/him. I teach SQL Server training classes, or if you haven’t got time for the pain, I’m available for consulting too.
Get Free SQL Stuff
"*" indicates required fields

5 Comments. Leave new
Another great breaking-it-down video, Brent!
You threw that “try updating your statistics before rebuilding your indexes” bit in there just to see who was paying attention, didn’t you?
😉
You can add one more columns for color, just saying 🙂 awesome stuff!
Excellent, thank you!
It would be neat if results from execution could update statistics. Some background process that sees the diff bitmap has changed and can offer new results. Not every execution, just when Clippy is not busy.