performance tuning

Adaptive Joins And SARGability

There’s a famous saying Non-SARGable predicates don’t get missing index requests. And that’s true! But can they also stifle my favorite thing to happen to SQL Server since, well, last week? You betcha!© One Sided I’m going to paste in some queries, each with something non-SARGable. There are two tables involved: Users and Posts. Only…
Read More

The 2017 Adaptive Join Optimization Eats Bad TSQL For Breakfast

Cheeky If you thought that title sounded familiar, you sure were right. That’s called a classical reference. So here we are, three whole years later, and yet another improvement to the engine promises to fix performance issues forever and ever. While this isn’t exactly an entirely new cardinality estimator, it’s an entirely new branch in…
Read More

SQL Server 2017: Quick Rundown

SQL Server 2017
5 Comments
ICYMI Playing with SSMS in the lab Microsoft released CTP 2 of SQL Server vNext (well, yesterday today, but who knows when this thing will hit?). There’s some great new stuff in the Engine in this release that I’m just crazy about getting to know better. Going through the Release Notes made me feel things…
Read More

Replacing ISNULL In A WHERE Clause

Execution Plans, T-SQL
4 Comments
I like blogging Really, I do. But sometimes I like a change of pace. Instead of blogging about this question, I posted it over on dba.stackexchange.com. Also, I thought it was an interesting question, and apparently many other people agreed. Not just because I wanted some more points, but because blog comments are notoriously sucky…
Read More

CTEs, Views, and NOLOCK

Humor, SQL Server
12 Comments
This is a post because it surprised me It might also save you some time, if you’re the kind of person who uses NOLOCK everywhere. If you are, you’re welcome. If you’re not, thank you. Funny how that works! I was looking at some code recently, and saw a CTE. No big deal. The syntax…
Read More

Indexed Views And Data Modifications

Indexing
5 Comments
Love/Hate When indexed views help, they make aggregation queries super fast. There are some kind of horrible limitations and requirements. When they hurt, your modifications slow to a crawl because SQL has to not only keep your horrible indexes synchronized, it also has to keep your indexed view indexes in sync now, too. But SQL…
Read More

Max Worker Threads: Don’t Touch That

SQL Server
57 Comments
More isn’t faster I’ve had people give me all sorts of janky reasons for changing Max Worker Threads. I’ve even had people tell me that someone from Microsoft told them to do it. The thing is, all changing that setting does is help you not run out of worker threads. It doesn’t make queries run…
Read More