Why is my query sometimes fast,
and sometimes terribly slow?

Even weirder, it just gets slow out of nowhere – even when you swear you haven’t changed anything.

Why Is This Query Sometimes Slow? – I show you how parameter sniffing happens, and why reboots/restarts seem to fix it, but it keeps coming back.

How to Start Troubleshooting Parameter Sniffing – a brief introduction of what parameter sniffing is, how to fix it during an emergency, and how to gather the data you’ll need to fix it right for the long term.

PSPO: How SQL Server 2022 Tries to Fix It – there’s a lot to like about this new feature, but one horrible, terrible, no-good, very bad downside that stops folks from using it.

Optimize for Unknown (Mediocre) – this query hint gives you a predictable plan, but it’s just usually predictably BAD, not predictably good.

Slow in the App, Fast in SSMS – Erland Sommarskog’s epic novel (dozens of pages long) about the causes and fixes for parameter sniffing and different execution plans.

My training classes – I offer a 1-day Fundamentals of Parameter Sniffing class, and then a 3-day Mastering Parameter Sniffing class for folks who have to fix this stuff a lot.

Session, Slides, Resources

Here’s a PDF slide version of the talk that includes the latest improvements in SQL Server 2022.

Here’s an all-demo session at SQLDay Poland:

Here is the latest version of the demo scripts I use in the demo: