development

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

Indexes For Kids

Indexing, SQL Server
18 Comments
Kid Tested When you work with something a lot, you tend to extrapolate concepts from it out to everything you see. That one person collecting tickets is a serial zone. That food truck line is a HEAP. The empty subway car that smells like a toilet is Replication. Stuff like that. If you have one…
Read More