SQLServerCentral Editorial

Query Tuning, Why Bother?

,

There are simply tons of resources on query tuning. I’ve written, in whole or in part, several different books on the subject. There are other books too. Videos. Articles. Blog posts. Online classes. In-person classes. Probably millions, if not billions, of words on this topic. Further, there are more coming.

I’m just going to say it.

Why?

A few of us, an exceedingly tiny few, will be able to spend the time. First, the time to learn how to gather query metrics, understand T-SQL, read execution plans, and understand how the query optimizer works within the SQL Server engine. Second, the time to practice these skills because you can’t just read a book, watch a video or attend a class and be able to do this. You will have to practice to get the skills down. Finally, the time to actually do the work. It’s not easy. It is time consuming.

Here's the deal, most of your businesses, they don’t care. Oh, they want everything to run fast, of course. However, go off to training? No. You’re needed here. Spend time studying and practicing? No, we really need your time spent on building new servers or deploying new code or whatever else they’re going to say has priority. Make things faster? Absolutely. What’s that? How long? No. You can’t do that.

More than this, most query tuning involves two things, because this is where the problems are, changing structures and changing code. For many, maybe even most, organizations, that is absolutely a non-starter. Maybe they’re running third-party software, so they can’t change the code, can’t change the structures. Maybe it’s ancient code put together at the dawn of the PC age by someone who retired 25 years ago and if it’s not broke, don’t even breathe on it hard. Maybe your development team refuses to work with you and you’ve got bad ORM code on top of an object-relational database (when you build your relational database out of objects instead of tables, nightmare). Whatever it might be, you’re not changing the code or the structures.

With all this, what happens? You buy bigger hardware. You buy more hardware. You go up to the next service tier in the cloud. Heck, Microsoft comes to your rescue with adaptive and intelligent query processing (wonderful stuff, truly, but not an actual panacea). You’re simply not going to be given that time.

So, why do so many people spend so much time on query tuning? Why are they always the most well-attended sessions at events, all over the world? What is it about this thing that far too many of us will never be able to do that we’re all spending insane amounts of time learning? I’m truly curious. If you know, please share.

Rate

5 (1)

Share

Share

Rate

5 (1)