Free Fundamentals of Query Tuning Week: Part 4, Improving Cardinality Estimation Accuracy

Before we get to the training in today’s episode, I wanna stop for a second to say thank you. We’re donating 10% of all sales this month to Doctors Without Borders. This morning, I sent in the first donation: so far, you’ve raised $4,792.58! That’s awesome. Now keep staying at home, learning, and flattening the curve.

Alright, now back to the training. So far, we’ve covered building a query plan, how to find the right queries to tune, and how parameters influence cached plans. Make sure to keep up with the series – on April 1, these posts will magically disappear.

When SQL Server’s estimated number of rows per operator are reasonably close to the actual number of rows, you’re likely getting a good plan. It may not be a fast plan, but it’ll accurately reflect the (possibly large) amount of work required.

You can still reduce the amount of work done by changing the query or the indexes.

We’ll step through a series of queries with increasingly harder cardinality estimation (CE) challenges so you can understand the mechanics of getting better estimates.

Part 1 (51m)

Part 2 (7m)

If you like this, you can keep learning this year with:

But you, dear reader, are too smart to pay full price. You can score my Live Class Season Pass for $995 or the recordings of the Mastering classes for $795. Use coupon code ReallyBadWeek for another 10% off that price, and I’ll donate 10% of the sales to Doctors Without Borders.

Demo Scripts

We’ll finish up the series tomorrow by covering common T-SQL anti-patterns.

Previous Post
Free Fundamentals of Query Tuning Week: Part 3, How Parameters Influence Cached Plans
Next Post
Free Fundamentals of Query Tuning Week: Part 5, Common T-SQL Anti-Patterns

2 Comments. Leave new

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.