There are a few enhancements in 12c that might make a big difference to performance for a small investment in effort. One of the important enhancements comes from changes in histograms – which improve speed of collection with accuracy of results. The changes are so significant that I chose the topic as my presentation at OpenWorld last year.
In 11g Oracle gave us the option for using an “approximate NDV (number of distinct values)” for rapid an accurate collection of basic column stats. In 12c Oracle extends the approximate NDV mechanism to frequency histograms and a new type of frequency histogram called a “Top-N histogram” – at the same time the maximum number of buckets allowed for a histogram has gone up from 254 to 2000 – although the default stays at 254 and you probably don’t need to increase it in most cases (remember the side effect you might have on the sysaux tablespace as Oracle retains the historical stats).
Height-balanced histograms are still relatively expensive to collect – but there is a newer type of height-balanced histogram named the hybrid histogram which gives you better information than the old height-balanced for the same amount of work, and thanks to the “Top-N” histogram you may find that some of your old (expensive, inaccurate) height-balanced histograms are replaced by cheap, accurate Top-N histograms.
In part 2 of this mini-series I’ll describe the new mechanism for the frequency histogram and the logic of the Top-N histogram, and in part 3 I’ll describe the mechanism and demonstrate the benefits of the Hybrid histogram. The takeaway from this note, though, is that you need to look at your current stats collection, and think about how a small change in strategy could both reduce the workload and improve the accuracy of your histograms.