比如,last_name='Smith',选择性被设置为last_name的不同值的数目的倒数,因为查询所选择的行包含N个不同的值
hr@ORCL> select index_name,distinct_keys/num_rows selectivity from user_indexes;
INDEX_NAME SELECTIVITY
------------------------------ -----------
REG_ID_PK 1
COUNTRY_C_ID_PK 1
LOC_ID_PK 1
LOC_CITY_IX 1
LOC_STATE_PROVINCE_IX 1
LOC_COUNTRY_IX .608695652
DEPT_ID_PK 1
DEPT_LOCATION_IX .259259259