Optimizer statistics – Gathering Statistics and Histograms

It’s such a mess with those histograms and statistics that I had to rewrite this post at least ten times. It’s such a mess that I still cannot believe how poorly maintained the global statistics are and how badly created the histograms are. Because of this mess and the depth of the topic this post is a bit longer than usual, but I find it really useful and I think it can give answers to many questions.

Continue reading

Optimizer statistics – Stale percentage and partitioning

Oracle is full of surprises, dbms_stats and optimizer statistics as well. That’s why I’m starting a new series named “Optimized statistics” in which I’ll cover some gathering and usage issues related to them.

As we know 11g has a cool feature which tracks how much data we had changed in our objects and if it’s more than the 10% /default/ it marks our statistic as stale. This is really useful because we don’t have to waste time scanning objects without having changed reasonable amount of data in them. But is it working for partitions? Well, not really, not till today.

Continue reading