Posts by Erik Darling

Functions Can Still Use Indexes, Kinda.

This sentence gets repeated a lot. You know the one: “Functions prevent the use of indexes.” Well, knowing you, it’s probably just your indexes. I’ve seen your indexes. Functions can use indexes, but even so, that doesn’t mean that they’re going to perform as well as queries without functions. Which Indexes? In the SUPERUSER database (yeah, I know, I’m…
Read More

Other People’s GitHubs: Fork, Clone, and Pull

SQL Server
4 Comments
Let’s say you found an interesting repository (code project) on Github, and you wanted to make a contribution to it. Here’s how it works. Profilin’ Did you know that Richie has a stored procedure call sp_DataProfile? I didn’t even know he had a website until today. I wish he’d talk about this stuff more. In…
Read More

Computed Columns: Reversing Data For Easier Searching

During Training We were talking about computed columns, and one of our students mentioned that he uses computed columns that run the REVERSE() function on a column for easier back-searching. What’s back-searching? It’s a word I just made up. The easiest example to think about and demo is Social Security Numbers. One security requirement is…
Read More

[Video] The Junior DBA Workout Plan

Videos
3 Comments
Squat, deadlift, overhead press, and bench press. In the gym, it’s easy to figure out what you need to be doing to get stronger. When you show up to work, you’re overwhelmed by all the things happening on your server(s), and you can’t figure out where to begin. In this session, we’ll talk about building…
Read More

SQL Server 2017 CU3 adds tempdb spill diagnostics in DMVs and Extended Events

Where have you been all my life? Whenever I’m teaching people about query tuning, two things come up almost without fail: parameter sniffing and tempdb spills. They’re not mutually exclusive — some queries will seemingly always spill to tempdb, whether parameter sniffing is present of not, and some queries experiencing issues with parameter sniffing will never spill…
Read More

SQL Server 2017 CU3 add a new CXCONSUMER wait type

SQL Server 2017’s new CXCONSUMER wait type was originally announced by Microsoft’s Pedro Lopes, and now it’s out. Here’s what it means for performance tuners. According to Pedro, this wait is the “safe” type of parallelism wait, as opposed to the CXPACKET wait type, which means work isn’t evenly balanced across all of our cores. Pedro blogged…
Read More

First Responder Kit Release: It’s Too Cold Not To Do A Release

You look just like a snake when you crawl like a worm. You can download the updated FirstResponderKit.zip here. sp_Blitz Improvements #1310: @CferMN reported quite an odd conversion error! Turns out, division was a better idea than multiplication. #1341: We we missing the newest version of Windows, and we had a broken link. Thanks to @JaySpatzfor letting us know!…
Read More

The Perils Of VSS Snaps

Backup and Recovery
34 Comments
So much, so often Ah, backups. Why are they so tough to get right? You start taking them, you find out you’re not taking enough of them, or that they’re not the right kind, or that you’re not using checksums or compression, or that you’re not storing them in the right place, or that the…
Read More