execution-plans

Are Bad Statistics Making My Query Slow? (Dear SQL DBA Episode 39)

Are Bad Statistics Making My Query Slow? (Dear SQL DBA Episode 39)

An important query is suddenly slow. Is it because statistics are out of date? This is tricky to figure out, and updating statistics right away can make troubleshooting even harder. Learn how to use query execution plans to get to the heart of the question and find out if stats are really your problem, or if it’s something else. In this 35 minute episode: 00:39 SQL Server 2017 Announced 01:10 New video from Microsoft’s Joe Sack demonstrating Adaptive Query Processing 03:05 This week’s question: Are bad stats making my query slow?
What's that Garbage in my Execution Plan? (Dear SQL DBA Episode 27)

What's that Garbage in my Execution Plan? (Dear SQL DBA Episode 27)

Today I was working on some code samples for a user question, and I hit a weird roadblock.

There was a bunch of garbage in my execution plan that I couldn’t explain. And by ‘garbage’, I mean a nested loop to a whole branch of code that I hadn’t asked SQL Server to run – and a warning about an implicit conversion possibly causing problems with the quality of my execution plan.

Estimated vs. Actual Number of Rows in Nested Loop Operators

Estimated vs. Actual Number of Rows in Nested Loop Operators

This is one of those little details that confused me a ton when I was first working with execution plans.

One problem with learning to work with plans is that there’s just SO MUCH to look at. And it’s a bit spread out. So, even when looking at a single tooltip, things can be confusing.

Let’s talk about the nested loop operator, who can be particularly weird to understand.

Live Query Statistics Don't Replace Actual Execution Plans

Live Query Statistics Don't Replace Actual Execution Plans

I like SQL Server’s new Live Query Statistics feature a lot for testing and tuning large queries. One of my first questions was whether this could replace using actual execution plans, or if it’s useful to use both during testing.

Finding: Both are useful. And both can impact query performance.