码迷,mamicode.com
首页 > 其他好文 > 详细

直方图及low_value、high_value

时间:2017-06-01 22:41:44      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:column   pad   density   value   distinct   and   详细   stat   sel   

直方图 Histogram是一种特殊的列统计信息,详细描述了目标列的数据分布情况。存储在数据字典基表 histogram$;

专门为了准确评估分布不均匀的目标列的可选择率、结果集的cardianlity。

详细描述了目标列的数据分布情况,并将分布情况记录在数据字典里。

 

select t1.column_name name,t1.num_distinct "#dst",t1.low_value,t1.high_value,
t1.density dens,t1.num_nulls "#null",t1.avg_col_len avglen,t1.HISTOGRAM,t1.num_buckets "#bkt"    
from user_tab_col_statistics t1
where t1.table_name=‘T‘;

NAME                                 #dst LOW_VALUE                                                        HIGH_VALUE                                                             DENS      #null     AVGLEN HISTOGRAM             #bkt
------------------------------ ---------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---------- ---------- ---------- --------------- ----------
ID                                   1000 C102                                                             C20B                                                                   .001          0          4 NONE                     1
VAL1                                  457 C105                                                             C22160                                                           .002353264        481          3 HEIGHT BALANCED        254
VAL2                                    6 C20202                                                           C20207                                                                .0005          0          4 FREQUENCY                6
VAL3                                    6 C20202                                                           C20207                                                                .0005          0          4 FREQUENCY                6
PAD                                  1000 203F2C5D523371586E695D456775533C565A522A4F3128234F43502F77353026 7E7E7438735D7A464E77205B7B79454D517E384069784521344735457E2F2120       .001          0        251 HEIGHT BALANCED        254


select utl_raw.cast_to_number(low_value) as low_value,
utl_raw.cast_to_number(high_value) as high_value
from user_tab_col_statistics
where table_name=‘T‘
and column_name=‘VAL1‘;


/*
LOW_VALUE HIGH_VALUE
---------- ----------
         4       3295
*/

直方图及low_value、high_value

标签:column   pad   density   value   distinct   and   详细   stat   sel   

原文地址:http://www.cnblogs.com/iyoume2008/p/6930988.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!