Between my travels, presentations, and Q & A moderation, I talk to a lot of people about a wide variety of SQL Server performance issues. Recently, I've had a few interactions where people believe things that are either altogether incorrect, or are only correct in a very narrow set of use cases. Yet their adamance that these things are universally true is unsettling.
So, I thought I would start a new series to help quell some of these myths. Not to point at people and prove that they're wrong, but to stop the spread. When they make these blanket statements in their workplace, or on twitter, or in forums, if they go unchecked, they can "teach" impressionable or less experienced users.
Note that I don't intend to prove that these things are never true, because some can certainly be true in isolated or contrived scenarios. My aim is simply to demonstrate at least one case where it is not true; hopefully, this can start to change these stubborn mindsets.
Here are some of the "facts" I've been told recently, in no particular order:
- “A clustered index is always better than a non-clustered index”
- “Dynamic SQL made my query slow”
- “PIVOT is faster than SUM(CASE)”
- “NULLs always cause terrible performance issues”
- “Execution plans are useless except for missing indexes”
- "NOLOCK is okay because a lot of people use it"
As I write each post, I'll update this page by linking the corresponding item in the above list.
Do you have any performance myths that are passed around as absolute fact, but you suspect (or maybe even know) that they aren't always true? Let me know in the comments below, on twitter, or at firstname.lastname@example.org.