ITPub博客

首页 > 数据库 > Oracle > Oracle 12c新特性 - Top frequency histogram 3

Oracle 12c新特性 - Top frequency histogram 3

原创 Oracle 作者:tolywang 时间:2014-03-24 11:48:56 0 删除 编辑

4.     生成top frequency histogram 的必要条件: 

1). The data set has more than n distinct values.  (n表示桶数量)
2). The percentage of rows occupied by the top n frequent values is equal to or greater than threshold p, where p is (1-(1/n))*100.
3). The estimate_percent parameter is set to AUTO_SAMPLE_SIZE in the DBMS_STATS statistics gathering procedure.

top n 在这里表示 top 8 的数据(查询出的前8行rows加总) :

select sum(CNT) from (
    select code , count(1) as CNT from   hw.test_tmp3  group by code  order by count(1) desc
   ) where  rownum<=8   ;

得出top 8 的value 总行数有187 ,  占用百分比为: 187/192 = 0.9739
1-1/n = 1-1/8 = 0.875 < 0.9739


显然,满足第二个条件,其他1,3条件也是满足的,所以生成了top frequency histogram.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/35489/viewspace-1128170/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    14695716