First Responder Kit Release: SQLBits was pretty awesome but now I have to do...
APRIL FOOLS! IT’S ONLY MARCH FIRST! Tomorrow. Butthead. You can download the updated FirstResponderKit.zip here. sp_Blitz Improvements #1407: @parlevjo2 gave us a check to make sure databases are owned...
View ArticleOf Windowing Functions And Where Clauses
Seen One, Seen’em All This isn’t about indexing! I promise. In fact, I’ve dropped all my indexes for this. It’s just that, well, I’ve seen this happen with two clients in a row, so maybe it’s time to...
View ArticleI Most Certainly Do Have A Join Predicate
FREAK OUT You wrote a query. You joined tables. You have the right ON clause. You have the right WHERE clause. But the query plan has a problem! BugBurg How Could This Happen To Me? Oh, relax. You’re...
View ArticleWhy sp_prepare Isn’t as “Good” as sp_executesql for Performance
sp_prepare For Mediocre You may remember me from movies like Optimize for… Mediocre? and Why You’re Tuning Stored Procedures Wrong (the Problem with Local Variables)! Great posts, Kendra! Following the...
View ArticleAzure SQL DB Managed Instances: Trace Flags, Ahoy!
When you talk to people from Microsoft They’re all “aw shucks” about Trace Flags. “Don’t really need’em!” “Eh, haven’t used one in years.” “Sometimes they’re good for troubleshooting, but…” Then you...
View ArticleAzure SQL DB Managed Instances: We’re All GUIDs
Six is having problems adjusting to his clone status Some funny things happen when you create databases up in a Managed Instance. For Instance (HEH!), you may expect this to yield some fruitful...
View ArticleAzure SQL DB Managed Instances: New Wait Stats
Incidental This is a long list that I haven’t had a change to dig through yet — all I did was compare them to which waits were occurring on my 2017 CU4 instance. There are about 174 of them that I...
View ArticleHow to Restore a SQL Server Database into Azure SQL DB Managed Instances Redux
Anything Brent Can Do There’s some things you can do with Managed Instances, and some ways you can look at data that you can’t do elsewhere. For instance, you have the ability to start an restore ASYNC...
View ArticleIf You Can’t Index It, It’s Probably Not SARGable
Thumbs Rule OK? When writing queries, it’s really common to want to take shortcuts to express some logic. I know, it “works fine”, and the results are “right”, and you have “more important” things to...
View ArticleSQL Server 2017 CU5: Finding Problems With Parallelism
Snow Is Temporary Cumulative Update 5 dropped for SQL Server 2017. Hooray. Poor Taryn. Nooooooooo, I just patched! — Taryn (@onlybluefeet) March 20, 2018 These new servicing models sure do make me glad...
View ArticleTable Valued Parameters: Unexpected Parameter Sniffing
Like Table Variables, Kinda Jeremiah wrote about them a few years ago. I always get asked about them while poking fun at Table Variables, so I thought I’d provide some detail and a post to point people...
View ArticleSo You Wanna Debug SQL Server Part 1
Start here! This is a gentle introduction to getting set up and started. I’m nowhere near as good at this as I want to be, but I’ve been inspired by a couple wizards: Bob the Ward and Paul the White....
View ArticleMissing Index Impact and Join Type
Just Another Way No matter how you delve into missing index requests — whether it’s the plan level, DMV analysis, or (forgive me for saying it), DTA, the requests will generally be the same. They’ll...
View ArticleHash Join Memory Grant Factors
Buskets Much like Sorts, Hash Joins require some amount of memory to operate efficiently — without spilling, or spilling too much. And to a similar degree, the number of rows and columns passed to the...
View ArticleFirst Responder Kit Release: Driving Miss Data
Ugh. Bungabase slow. When Grog try count meat, Glug eat meat. Then Grog get hungry and Glug try count meat. Bungalock. Need big head make bungabase fast. You big head? You can download the updated...
View ArticleThe Many Mysteries of Merge Joins
Not A Single Picture Of A Zipper Image humbly borrowed from https://70srichard.wordpress.com/2014/12/17/beverly-hills-cop/ There are some interesting things about Merge Joins, and Merge Join plans that...
View ArticleColumn Store Deadlocks: Missing Information
People seem to care about deadlocks That’s why I wrote sp_BlitzLock. Why not sp_BlitzDeadlock? Well, I had this song stuck in my head. But enough about that. While poking around with things recently, I...
View ArticleHow To Break SQL Server’s XML Data Collection
Oh, XML When we first met, it was about 2011. I had to load files full of you into a table. It wasn’t so bad. Seriously. You were well-formed, and didn’t change from file to file. Even using SQL Server...
View ArticleParking Garages And Predicates
Hotels on Wheels Parking garages and predicates have a “lot” in common. GET IT? No no but seriously. They do. If you’ve ever lost your ticket, forgotten where you’ve parked, or just driven around...
View ArticleIndex Key Column Order And Supporting Sorts
Whatever Man When tuning queries that need to sort large amounts of data, sometimes it makes sense to stick the ordering elements as the leading key column(s) in your index. This allows SQL Server to...
View Article