One Thing The “New” Cardinality Estimator Does Better

Or “Default”, If That’s Your Kink

Look, I’m not saying there’s only one thing that the “Default” cardinality estimator does better than the “Legacy” cardinality estimator. All I’m saying is that this is one thing that I think it does …

Query Tuning SQL Server 2019 Part 4: Long Live The Query Tuner

Rumors Of My Demise

Let’s talk about some common hints that people use to fix parameter sniffing:

  • RECOMPILE: Won’t work here to get us a better plan for VoteTypeId 5, because it sucks when the optimizer knows what’s coming

Query Tuning SQL Server 2019 Part 3: Who Died And Made You The Optimizer?

Be Yourself

We’ve got a problem, Sam Houston. We’ve got a problem with a query that has some strange issues.

It’s not parameter sniffing, but it sure could feel like it.

  • When the procedure compiles and runs with VoteTypeId 5,

Query Tuning SQL Server 2019 Part 2: Big Databases, Big Ideas

Are We Still Friends?

When I first wrote this demo, I called it dbo.ParameterSniffingMonstrosity.

Because , you know, it’s really terrible.

CREATE OR ALTER PROCEDURE dbo.VoteSniffing( @VoteTypeId INT )
        SELECT   ISNULL(v.UserId, 0) AS 

Query Tuning SQL Server 2019 Part 1: Changing Databases

Teeth To Grit

I’ve always had trouble standing still on SQL Server versions, but most companies don’t. Hardly anyone I talk to is on SQL Server 2017, though these days SQL Server 2016 seems more common than SQL Server 2012, …