I would love to see the Database Engine Tuning Advisor (DTA) pulled from the product. Completely. Heck, I feel bad that I included a chapter on it in my query tuning book (all updated for SQL Server 2014 by the way). Let me tell you why we need to pull this tool.
First, I understand its purpose. It’s supposed to be a fast and easy way to get some performance tuning done for people who just don’t have the time or knowledge to go through the full process of gathering metrics, evaluating poor performers, understanding root causes and applying indexes to fix those causes. I also readily acknowledge that it actually is an amazing piece of software. If you don’t agree with that, go read this white paper. With those acknowledgements in place, I still think there are two distinct problems with the approach and a serious fundamental issue with the premise. Let’s talk about the problems of the approach first.
Many, probably even most, of your query performance problems are in your T-SQL. Some of your query performance problems are in your table structure. Some of your query performance problems are in your indexes and statistics, but not a majority. The DTA can suggest indexes, statistics, materialized views, and partitioning (partitioning for performance I might add, not data management, and that opens up a completely different can of worms we can’t address here, I don’t have time). In short, it can’t address your number one problem, your code. Since it can’t address the number one problem, all it can do is work around the edges. You’ll run this thing, think you’ve addressed your issues, but your issues are still there and now you’re just as stuck as before you found the DTA and ran it. It just doesn’t fix the core issue, your code.
The second problem I see with it is that it doesn’t have enough intelligence built into it’s functionality. I say that with some reluctance because it really is a pretty amazing piece of functional code. But it suffers from a couple of shortcomings there. It’s completely dependent on the load provided to it. If that load is off, it’s recommendations are off because it just can’t have the intelligence to recognize that a poorly representative load has been provided. This lack of intelligence is supposed to be offset by the person running the DTA to ensure that they are gathering the right information and that they can interpret and test the resultant recommendations. Which brings us to the fundamental issue with the premise.
This is supposed to be run by people with no internals knowledge. Right? BUT! These people are also supposed to make a judgement based on the recommendations whether or not they should be accepted. Further, they should test all the recommendations prior to applying them to their production server. They also must gather a well structured and meaningful representative load from their production system in order to supply the DTA with good information. Further, the very sophisticated set of tests around the DTA actually makes a fundamental assumption that could be radically off, that the person designing the database has done a good and thorough job of correctly normalizing the structures. You agree with all these assumptions on the part of the DTA? Am I alone in thinking that we have a problem here? If people lack any understanding of the internals they won’t be able to judge those recommendations. If people don’t have the ability to gather and interpret performance metrics they won’t be able to test the suggestions of the DTA or provide it with the necessary test load. In short, the DTAÂ can’t be relied on to solve the problem it’s supposed to solve because of the root cause of that problem, peoples lack of knowledge and understanding.
I won’t even get into finding indexes with names like this:
[_dta_index_TD_13_15_1334295813__K44_K1_K8_K57_K17_K60_K16_2_3_4_5_6_7_9_10_11_12_13_14_15_18_19_20_21_22_23_24_25_26_27_28_29_]
Instead of evaluating the suggestions made by the DTA and applying just those that make sense and will have a positive impact, people assume that every single suggestion from the tool is Gospel. They apply them all, without thinking, without knowledge, without appreciation of the possibility, sometimes even the likelihood, of serious negative impact.
I recognize that many people are stuck. They have a SQL Server instance that’s causing them pain and they don’t have the knowledge necessary to fix it. Further, I know a few of you have used this tool successfully in some situations. I agree that there ought to be some way to mechanically and automatically tune the server. However, the DTA is not that tool, despite it’s clear and obvious sophistication. Let’s get rid of it.
Want to learn how to tune queries? I’m putting on an all day seminar at Connections in September. Click here right now to register. We won’t use the DTA.
I couldn’t agree more Grant. I see tables all the time that have dozens of indexes on them all suggested by the DTA (or missing indexes from SSMS) that are 99% useless or even harmful to the CRUD operations. It simply works too much in a vacuum.
Thanks Andy. Good to know I’m not alone.
Can I second your motion? Actually I would like to see MS purchase Qure Optimizer (http://www.dbsophic.com/qure-optimizer.html), a brilliant product that I think has kind of gone into mothballs
Ami’s organization? He’s great. Smart guy. I haven’t tried that tool, but I wouldn’t be at all surprised by it being pretty good.
Grant, great post as usual.
Personally, whenever I find dta_something indexes, I know they’re the first candidates for the trash bin.
Qure Analyzer is a great product, though it suffers some limitations compared to RML utilities (not scriptable, to name one).
[…] Deploy Environments Monitoring SQL Server Transactional Replication Latency via PowerShell and RMO Database Engine Tuning Advisor SQL SERVER – Identify Disk Latency on SQL Server Box Using PowerShell The ambiguity of the ORDER […]
[…] Database Engine Tuning Advisor – Grant Fritchey (Blog|Twitter) […]
It’s not perfect but that doesn’t mean it’s useless. On a busy prod server the dba can get a good load and judge the recommendations of the dta. They’re recommendations only. The user will have to make judgement. To me it’s still useful. Thank you Grant for your time.
Golam,
Don’t you find that anyone who can judge the recommendations probably already has set up monitoring and has done design work and can arrive at a place where they make their own assessments anyway? The tool just doesn’t add much value, if any, for those who are able to accurately assess it’s recommendations. That’s what I’ve seen.
When I was doing consulting, Client said all queries are running slow . Then I went and checked indexes on all tables . To my horror , there are 400 to 500 indexes on each table . When I enquired , a person not familiar with SQL Server ran DTA and created blindly indexes suggested by DTA , most are duplicate indexes So there are people who are new and without knowing consequences just press buttons. There should be sufficient warning to avoid these type of issues
That’s not the first time I’ve seen that kind of story. I agree.