Sql-server – Why do Statistic recommendations disappear from DB Tuning Advisor after implementing recommended indexes

index-statisticsperformanceperformance-tuningsql serversql-server-2008-r2

Why is it, when analyzing a query through Database Engine Tuning Advisor, statistic recommendations disappear after some or all of the suggested indexes are implemented?

For example, Query X suggests 5 indexes, and 5 sets of stats. After I implement the indexes I rerun the analysis (just curiously seeing what the efficiency improvement comes from, indexes or stats) and notice that not only are the indexes gone from the recommendations, but the statistics are also.

Obviously, these aren't the stats that are inherently a part of the index that was built.

Best Answer

After I implement the indexes

I highly recommend you to read Aaron's excellent blog post:

There are stats automatically created with indexes, so there's no statistic to suggest when an index exists (because by definition that statistic is already there). DTA is suggesting both an index and a stat - an index is usually best, but most costly in terms of maintenance; a stat is second-best, and can help with cardinality estimates, but not with things like seeking or sorting. Not sure why it's obvious these aren't the same stats - but it could also be that those queries have benefitted enough from the indexes you created that there is no further benefit to derive from adding stats.


This answer consists of comments converted into a community wiki answer