Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

When does Dropping Stats help - response (1) by Fred

$
0
0

This is a difficult question to answer, but here goes:
a. 1 - The optimizer in effect is biased to assume that if you bothered to collect the stats, they must be relevant.
a. 2 - If you have denormalized data or other "highly correlated" groups of columns, but collect (only) single-column stats, the optimizer may mistakenly assume the columns are independent / non-correlated and estimates may vary wildly from actual performance.
b. Not sure what "like above" refers to. If you have a join qualified on multiple columns, you may need multi-column stats instead of / in addition to single-column stats.
c. In principle, stats should be at least as good as random sampling. But stats on (a) and (b) individually might not be as good as random sampling for (a,b), or vice versa.
This is NOT to say that you should collect stats on every possible combination. Collecting stats is relatively expensive. Some would say only collect stats if it changes the query plan - but even if the query plan does not change, a more accurate cost estimate may be valuable for workload management purposes.
If none of the above comments seem to apply, please open an incident. There could be a bug, or an opportunity to improve the optimizer.


Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>