Quantcast
Channel: execution plan Archives - Grant Fritchey
Browsing all 58 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Changes to SQL Server 2012 Execution Plans

I’ve been working with execution plans quite a lot in SQL Server 2012. There are a number of changes, most of them associated with new or different functionality. I had not noticed anything really...

View Article



Image may be NSFW.
Clik here to view.

Execution Plans, What Do I Look At?

The question came up, what are the top 3-5 things that you look at in a query. I realized then that I hadn’t really written them down. There are some areas that let me know pretty much immediately...

View Article

Image may be NSFW.
Clik here to view.

Avoiding Bad Query Performance

There’s a very old saying, “When you find yourself in a hole, stop digging.” And my evidence today is: That’s certainly not the hairiest execution plan I’ve seen. In some ways, it’s not all that...

View Article

Image may be NSFW.
Clik here to view.

Execution Plan for a User Defined Function

When you execute a multi-statement user-defined function you may see an execution plan that looks something like this: It appears as if the cost of the UDF is free. This is especially true if you use...

View Article

How to Drop One Plan from Cache

While presenting this weekend at SQL Saturday #117 in Columbus, OH (great event, if you missed it, you missed it), I had what I thought was a little piece of throw-away code, but several people from...

View Article


Querying Information from the Plan Cache, Simplified

One of the great things about the Dynamic Management Objects (DMOs) that expose the information in plan cache is that, by their very nature, they can be queried. The plans exposed are in XML format, so...

View Article

Image may be NSFW.
Clik here to view.

Execution Plans … In the Cloud!

If you’re moving to a fully-fledged SQL database as part of Azure you may never even touch SQL Server Management Studio (SSMS). Instead you may do all the management of your SQL database through the...

View Article

Image may be NSFW.
Clik here to view.

Clustered Indexes Have Statistics Too

It may seem obvious, but I’ve heard more than one person suggest to me that statistics on a clustered index just don’t matter. That if the clustered index can satisfy a given query, it’s going to get...

View Article


Image may be NSFW.
Clik here to view.

Saving Execution Plans on Azure SQL Database

In my previous post showing how to get to execution plans in the Database Management Portal, I showed that it’s pretty easy to put a query in a query window and get the execution plan. This allows you...

View Article


Image may be NSFW.
Clik here to view.

Azure SQL Database Execution Plan Differences

I’ve been exploring execution plans in Azure SQL Databases a lot lately. I’m getting a presentation together for  some upcoming SQL Saturday events (first one is SQL Saturday #177, Silicon Valley). If...

View Article

Image may be NSFW.
Clik here to view.

Execution Plans in Azure SQL Database

Microsoft has stated pretty clearly that they’re putting code on Azure first, ahead of the desktop. Which makes one wonder when we’re going to start to see some of this cool stuff within SSMS. What...

View Article

Execution Plan Cost Estimates

It’s been emphasized over and over that the costs of operations within an execution plan, and the estimated costs of the plan themselves are, in fact, estimates. But it goes further than that. The...

View Article

Image may be NSFW.
Clik here to view.

Why the Lazy Spool Is Bad

First thing, there are no bad operators, just bad parents, uh, I mean query writers, or database designers, or ORM tools. Why do I say this? Because all the operators within a query execution plan...

View Article


Image may be NSFW.
Clik here to view.

SQL Server 2014 and the New Cardinality Estimator

Cardinality, basically the number of rows being processed by an operation with the optimizer, is a calculation predicated on the statistics available for the columns in question. The statistics used...

View Article

Image may be NSFW.
Clik here to view.

Finding Mistakes

Ever had that moment where you start getting errors from code that you’ve tested a million times? I had that one recently. I had this little bit of code for pulling information directly from query...

View Article


Image may be NSFW.
Clik here to view.

Natively Compiled Procedures and Execution Plans

The combination of in-memory tables and natively compiled procedures in SQL Server 2014 makes for some seriously screaming fast performance. Add in all the cool functionality around optimistic locking,...

View Article

Image may be NSFW.
Clik here to view.

Differences In Native Compiled Procedures Execution Plans

All the wonderful functionality that in-memory tables and natively compiled procedures provide in SQL Server 2014 is pretty cool. But, changes to core of the engine results in changes in things that we...

View Article


Image may be NSFW.
Clik here to view.

Natively Compiled Procedures and Bad Execution Plans

I’ve been exploring how natively compiled procedures are portrayed within execution plans. There have been two previous posts on the topic, the first discussing the differences in the first operator,...

View Article

Image may be NSFW.
Clik here to view.

The Utility of Execution Plans in Natively Compiled Procedures

I’m actually having problems identifying the utility of execution plans when working with natively compiled procedures. Or, put another way, why bother? I’ve posted a couple of times on natively...

View Article

Image may be NSFW.
Clik here to view.

“Pretty Plans vs. Performance” or “Grant Gets Pwned”

If you get an execution plan that looks like this: I wouldn’t blame you for immediately thinking about query tuning. Especially if the code that generated it looks like this: SELECT soh.OrderDate,...

View Article
Browsing all 58 articles
Browse latest View live




Latest Images