Execution Plan Interpretation

Reading operators, properties, plan shape, and actual-versus-estimated behavior.

92 associated posts86 primary posts

Performance Tuning

SQL Server 2017 Showplan Schema Is Available

File this under...
Things probably only I care about. But the Showplan Schema for SQL Server 2017 popped up... well, I caught it last night. I probably could have written this sooner, huh?

So what's new? Well, if I compare the 2016 SP1 schema using KDiff, a few things stand out. Some I've blogged about, and some... I have no idea what they are.

Read more about SQL Server 2017 Showplan Schema Is Available 2 comments — Join the discussion
Performance Tuning

How Much Can One Row Change A Query Plan? Part 1

Last week, Erik showed two queries that were aaaaalmost identical, with only one extra column - and the execution plans were dramatically different. Adding just one eensy column made all the difference in the world.

Now, check out these two queries - the first asks for top 100, and the second asks for top 101:
[crayon-6a71e8fa76f34544829360/]
They produce estimated plans that seem identical (PasteThePlan), even down to the estimated costs - note that they're both 50%:

Read more about How Much Can One Row Change A Query Plan? Part 1 13 comments — Join the discussion
T-SQL & Development

What Do You Think About ORMs?

I was recently asked what I thought about ORMs (Entity Framework, NHibernate, Dapper, etc) while we were looking at implicit conversion warnings in execution plans.

Before I answered the question, I let them know that my answer is based on being a production DBA and the numerous performance problems I have had to troubleshoot that were caused by improper usage of an ORM.

Read more about What Do You Think About ORMs? 26 comments — Join the discussion

[Video] Office Hours 2017/06/07 (With Transcriptions)

This week, Brent, Erik, and Richie discuss running SQL Server 2017 CTP on Linux, receive side scaling on servers and VMware, query tuning, nested roles vs. assigning roles to users, hierarchical data type, apps and scripts for automating restores, and learning Azure and AWS. The audio's kinda rough this week because Brent & Erik were…

Read more about [Video] Office Hours 2017/06/07 (With Transcriptions) 7 comments — Join the discussion
Performance Tuning

What’s the Difference Between Estimated and Actual Execution Plans?

I'm going to use the dbo.Users table in the StackOverflow demo database and run a pretty simple query: [crayon-6a71e8fa7af19151032579/] First, hit Control-L in SSMS and get the estimated execution plan. Here it is: Click on the plan, and hover your mouse over the various operators. You'll notice that almost all of the fields are prefixed…

Read more about What’s the Difference Between Estimated and Actual Execution Plans? 2 comments — Join the discussion

My How to Think Like the Engine Class is Now Free – and Open Source

You’re a developer or a DBA, and you’re comfortable writing queries to get the data you need. You’re much less comfortable trying to design the right indexes for your database server. You've never had a formal database internals class, and you don't really have the patience to read a book on it - but you want a quick foundation.

Read more about My How to Think Like the Engine Class is Now Free – and Open Source 21 comments — Join the discussion
News & Opinion

Announcing PasteThePlan.com: An Easier Way to Share Execution Plans

Since the dawn of man, people have struggled with sharing execution plans with each other for performance tuning. Now, it's easy. First, get yourself a plan: Get the estimated execution plan by hitting control-L or clicking Query, Display Estimated Plan. Right-click on the graphical plan, and click View XML. Copy all of that. Or even…

Read more about Announcing PasteThePlan.com: An Easier Way to Share Execution Plans 18 comments — Join the discussion
News & Opinion

Bad Idea Jeans Week: Dynamically Generating Long Queries

As part of an experiment, I needed to build a really long query. (Don't ask.)

From another recent experiment, I know that SQL Server won't let a query return more than 65,535 columns. I set about writing a one-line query that would return 65,535. I'm a big fan of writing the simplest reproduction scripts possible - I don't want them to rely on tables if they don't have to - so we'll start a CTE like this:

Read more about Bad Idea Jeans Week: Dynamically Generating Long Queries 12 comments — Join the discussion