Blogs

The Case of MAX() Requiring an Index Scan, While TOP(1)/ORDER BY DESC Does Not

Most of the time in SQL Server, the MAX() function and a TOP(1) ORDER BY DESC will behave very similarly.

If you give them a rowstore index leading on the column in question, they’re generally smart enough to go to the correct end of the index, and – BOOP! – just pluck out the data you need without doing a big scan.

Continue reading

SQL Server 2026: BAGI Edition (#TSQL2SDAY 100!)

It’s T-SQL Tuesday’s 8 year birthday (or close enough), and Adam Machanic has challenged us with the question: what will the world be like when T-SQLTuesday turns 16?

Continue reading

New Free Webinars! Index Tuning, Free Q&A, and Isolation Levels

I’ve got a whole slew of free webcasts and events coming this spring. I’m excited about each and every one of them!

Continue reading

What is a Morally Equivalent Execution Plan, and Why Is It Useful?

I recently wrote a fairly complicated post, called “Forced Plan Confusion: Is_Forced vs Use Plan = True.”

You do NOT need to go read that post to understand this one. I think I’ve found simpler way to explain the most important part of that post - and why it’s A Very Good Thing.

Continue reading

New Free Posters & Desktop Backgrounds for Download

I love fun desktop wallpapers

You may have noticed that there’s something about cartoons combined with SQL Server that makes me happy. Having those images on my desktop inspires me and helps me feel creative. Work should involve fun.

Get the download on GitHub

Continue reading

EstimateRowsWithoutRowGoal helps you see: is it a statistics problem?

SQL Server Management Studio version 17.5 adds a welcome feature for execution plans: a new visual attribute named EstimateRowsWithoutRowGoal.

Continue reading

Overheard: “I just think there’s not that many women who enjoy coding. And I say that based on my daughter, too.”

I’m at the Microsoft MVP Summit in Redmond, Washington this week. This is a great event for learning from the folks building amazing new technology at Microsoft, giving feedback and representing the community, and meeting and learning from other MVPs from around the world.

Continue reading

Forced Plan Confusion: Is_Forced vs Use Plan = True

Identifying that a query plan has been bossed around in Query Store can be a bit tricky, because it can appear in different ways.

Continue reading

Why I Love the Automatic Plan Correction Auto-Tuning Feature

I’m thrilled to have just finished and published a new course on Automatic Tuning in SQL Server. This feature is available in SQL Server 2017+ and Azure SQL Database.

Update: this course is now open and totally free to all.

Continue reading