Posts by Erik Darling

MAX Data Types Do WHAT?

SQL Server
23 Comments
Users are horrible, I know You can just never rely on them to pass in reasonable search strings. When you write stored procedures to retrieve information for them, it’s really tempting to define all your string variables as MAX length. As long as the actual data type, N/VARCHAR matches, you’re cool, right? Avoid that pesky…
Read More

Set Statistics… Profile?

Development
4 Comments
Forgotten, But Not Gone Two of the best built-in tools to figure out if your query tuning efforts are headed in the right direction are SET STATISTICS TIME ON and SET STATISTICS IO ON. If you’re really fancy, you can use SET STATISTICS TIME, IO ON. By fancy I mean lazy. By lazy I mean…
Read More

The Law Of The Minimum

Monitoring
15 Comments
I like science fiction Not enough to go to conventions, or memorize every line, but I have some opinions on things. Dune is probably my favorite series of stories in the genre. Yes, I think Paul would beat Luke in a fight. Sorry, Star Wars people. He’s just kind of a wimp. Throw grenade, digress One…
Read More

Divide By Zero Hero

SQL Server
20 Comments
Alright, so at least they’re not NULLs But zero is actually literally much more problemaaaaatic per se (add lots of annoying vocal fry to this when you read it) when it comes to math. Or maths, depending on which message board you read. Zero has a weird history. It wasn’t always a number, and it…
Read More

What To Do If sp_BlitzFirst Warns About High Compilations

Compiles Aren’t The Same As Recompiles If you’re seeing high RECOMPILES, this post isn’t for you. We’ll talk about the differences between compiles and recompiles, but not how to troubleshoot recompiles. Recompiles mean one of two obvious things: You have a RECOMPILE hint at the stored procedure or statement level, or SQL found a reason…
Read More

DBA Days: Scripts from Downtime Train

SQL Server
8 Comments
ostress is so much fun It’s totally free to download and use as part of Microsoft’s RML Utilities. What else is in there? Stuff I’ve never used! I hear you can read trace files or something else perfectly adequate. Even though it’s a CLI, it’s still a bit less insane and confusing than HammerDB. Plus…
Read More

DBA Days: Money for Nothing, Chips for Free

SQL Server
3 Comments
Throwing hardware at it We gotta move these E5-2670 v3s These were just sitting around Dell. On a table. Not doing anything. They might have been broken; I’m not sure. But that’s not the point. The most meager of server blades hanging out here had 128 GB of RAM in it. One-hundred-and-twenty-eight. Gigabytes. Let that sink…
Read More

Where Do Missing Index Requests Come From?

Indexing, sp_BlitzIndex
1 Comment
Be honest, here You don’t care about most indexing problems. Duplicates, Borderline Duplicates, Unused, Wide, Non-aligned Partitions… All you’re here for are the Missing Indexes. Wham, bam, your query finishes in less than a second, ma’am. Take this quarter, go downtown and have a rat gnaw that thing off your face. And I get it.…
Read More