Oracle 单表选择率

听了猫大师的课,对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=''
原文地址:https://www.cnblogs.com/slgkaifa/p/6985136.html