oracle 12c直方图收集的增强

在oracle 12c之前,收集直方图信息是相对比较耗费资源的,因为要重复扫描几次;在oracle 12c中,则有较大的提升,具体可参考https://jonathanlewis.wordpress.com/2013/07/14/12c-histograms/。

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 and accurate collection of basic column stats. In 12c Oracle extends the mechanism to frequency histograms and a new type of frequency histogram called a “Top-N” histogram (also called a “Top-Frequency”histogram). At the same time the maximum number of buckets allowed for a histogram has gone up from 254 to 2000 2048 [corrected: see note 4 below] – 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 sysauxtablespace as Oracle automatically 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.

转载于:https://www.cnblogs.com/zhjh256/p/9867017.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值