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 ArticleExecution 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 ArticleAvoiding 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 ArticleExecution 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 ArticleHow 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 ArticleQuerying 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 ArticleExecution 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 ArticleClustered 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 ArticleSaving 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 ArticleAzure 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 ArticleExecution 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 ArticleExecution 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 ArticleWhy 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 ArticleSQL 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 ArticleFinding 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 ArticleNatively 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 ArticleDifferences 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 ArticleNatively 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 ArticleThe 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“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
More Pages to Explore .....