Oracle 单表选择率

来源:互联网 发布:单片机串口是什么 编辑:程序博客网 时间:2024/06/05 02:24

听了猫大师的课,对Oracle CBO又加深了一步理解:

单表选择率:

selectivity=1/ndv*a4nulls 

ocard来自dba_tables.num_rows
ndv 来自dba_tab_col_statistics中的num_distinct where 条件为 owner='' AND table_name='' and column_name=''
a4nulls 来自dba_tab_col_statistics中的num_nulls where  条件为 owner='' AND table_name='' and column_name=''
0 0