Execution-Plans

Category: execution-plans

A Case of Inconsistent Wait Stats and Query Duration

A Case of Inconsistent Wait Stats and Query Duration

You know how they say “don’t sweat the small stuff”?

That’s good advice for lots of things, but when it comes to query tuning - I WANT TO KNOW MORE when something is inconsistent. I just can’t let it go. I go total X-Files: The Truth Is Out There.

Continue reading

Adaptive Queries in Standard Edition: Interleaved Exec for Multi-Statement TVFs

Adaptive Queries in Standard Edition: Interleaved Exec for Multi-Statement TVFs

It’s tough to keep track of which features work in each version of SQL Server, and which Editions support them.

My memory told me that the new Adaptive Joins feature in SQL Server 2017 was Enterprise Edition only…  and that’s correct, but I didn’t realize that the fancy new feature to make Multi-Statement TVFs smarter has much wider licensing.

Continue reading

Auto-Tuning: Automatic Plan Correction is Cleared on Restart

Auto-Tuning: Automatic Plan Correction is Cleared on Restart

The new Enterprise Automatic Tuning feature in SQL Server 2017 may sound intimidating at first – one question I get a lot lately is whether or not there’s a future for DBAs. Will Auto-Tune mean we don’t need any more human tuning?

Well, not anytime super soon.

Continue reading

Why Is My Function Missing From sys.dm_exec_query_stats and Query Store?

Why Is My Function Missing From sys.dm_exec_query_stats and Query Store?

I just spent 90 minutes of my life figuring out a detail about sys.dm_exec_query_stats which I’m pretty sure I figured out five years ago, but didn’t write a blog post about.

Time to write a blog post, so I can save time when I go searching for this in a couple years.

Continue reading

What is a Morally Equivalent Execution Plan, and Why Is It Useful?

What is a Morally Equivalent Execution Plan, and Why Is It Useful?

on March 12, 2018

I recently wrote a fairly complicated post, called “Forced Plan Confusion: Is_Forced vs Use Plan = True.”

You do NOT need to go read that post to understand this one. I think I’ve found simpler way to explain the most important part of that post - and why it’s A Very Good Thing.

Continue reading

IF Statement Branching and Parameter Sniffing

IF Statement Branching and Parameter Sniffing

on July 12, 2017

It can be tricky to remember that SQL Server doesn’t short circuit on IF statements in stored procedures. Even when you know this, sometimes it’s hard to recognize the impacts.

Continue reading