Estimated I/O cost, a sign of an expected spill

1 Comment
Some execution plan properties get a lot of attention. Others tend to be mostly overlooked. But even those properties can, sometimes, relay interesting information. Estimated Operator Cost The Estimated Operator Cost property is one of those that does get a lot of attention. Perhaps even too much. When you look at an execution plan in SQL Server Management Studio, or in Azure Data Studio., it conveniently marks each operator with a line such as “Cost: 34%”. And some third party tools, such as SentryOne’s Plan Explorer, even go a step further and color code this cost in red, yellow, or…
Read More

T-SQL Tuesday #129 – Time capsule

1 Comment
The theme for the August 2020 edition of T-SQL Tuesday brought back memories. Back when my children were in elementary school, the school asked them to bring things to put in a time capsule. I was clueless what that would be, so my children patiently explained that it’s a container they’d fill with “things” and then bury somewhere, for future generations to dig up, open, and then marvel at how life was in our time. And now, Tamara Clark (b|t) has asked the SQL community to build our own time capsule. She asks us what we want future generations to…
Read More

PASS Virtual Summit 2020

You probably have heard this already: PASS has decided that PASS Summit will go virtual this year. Instead of assembling in Dallas, we’ll all stay home. Presenters will present from behind their computers, at home. Attendees will watch on their devices, from their homes. It will sort of be the same, but not the same at all! I know a lot of you are debating whether to attend or not. I understand that. The live, face to face experience is one of the cornerstones of PASS Summit, of any community event. A virtual event will never capture that the same…
Read More

Stop the “seeks are better than scans” myth, now!

Can we please all stop the nonsense? Now? While I admit that I haven’t seen the literal statement “seeks are better than scans” in a while, I do keep encountering that generic idea, just in other words. Just as recently as this week, on the very popular blog of my good friend Pinal Dave (who knows I’m writing this post), I read this: “The query was indeed running extremely slow […] even though the main operator on the table was index seek.” So? What gives you the impression that an Index Seek should give better performance? Is this an artefact…
Read More

T-SQL Tuesday #128 – My mistake

My second favorite method of learning is to learn from my mistakes. Or as I often put it, learn from your mistakes so that the next time you can make a new one, which isn’t quite as boring as repeating the same mistake over and over again. But even better than learning from my mistakes is learning from yours. No, not you specifically. Everyone else. Because while learning from mistakes is useful, making mistakes isn’t fun at all. If someone else already made a mistake, the why should I have to repeat that? And apparently I am not alone in…
Read More

When the actual IO statistics seem wrong

I recently wrote about the Actual I/O Statistics property that you can find in an execution plan plus run-time statistics, which allows you to see exactly how much I/O was done by each individual operator. This is a great feature and I’m very happy with it. But, as I already indicated at the end of that post, there are some issues as well. Let’s take a look at the dark side of this property. Error, does not compute So, let’s look at an example, based on this simple query: SET STATISTICS IO ON; SELECT sod.OrderQty, sod.UnitPrice FROM Sales.SalesOrderDetail AS sod…
Read More

T-SQL Tuesday #127 – Non SQL tips and tricks

The June 2020 edition of T-SQL Tuesday is hosted by Kenneth Fisher (b|t). He wants us to share some tips and tricks … for anything that’s not SQL Server. I first thought I’d have to sit this one out. I’ve never been really big on tips and tricks. I sometimes look in awe at all the handy stuff I see other people do. And then I try to memorize it all … and fail miserably. For me, it is apparently more efficient to just use the simple, standard methods, then it is to try to memory all the hacks and…
Read More

Actual I/O Statistics in the execution plan

One of the things that many people look at when tuning their queries is the amount of I/O required per execution. Of course, when the CEO is waiting for their favorite report to render, we only care about elapsed time. But for most other queries, especially for those that run thousands of times each day, reducing I/O is often our main objective. The old ways The standard method to get insight in the amount of I/O that was done while executing a query is to precede the query with the statement SET STATISTICS IO ON . (The same setting can be…
Read More

Row counts and arrow width, more missing nodes

Over the past weeks, I have published several posts about Actual Number of Rows, Estimated Number of Rows, how they are reflected in the arrow width in the graphical execution plan, and several scenarios where this can be wrong or misleading. And now, after telling you in my previous post that this was the last in this series, I am back with yet another one. I discovered this only very recently. It was not planned for the series, because I was not aware of it. Until I ran into it while preparing a demo, got fooled by it, investigated it,…
Read More

Row counts and arrow width, Compute Scalar

This is the fifth and final post in my May 2020 series about the Actual and Estimated Number of Rows properties in execution plans. In the previous posts, I talked about how you can use them, the confusion a Nested Loops operator can cause, how sometimes the graphical representation is based on input rather than output, and how missing nodes can catch one off guard. This last part focuses on the issue that is perhaps the most common of all: the lack of data reported by a Compute Scalar operator, and how this affects the graphical execution plan Compute Scalar…
Read More
Menu

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close