SELECT INDEX_NAME "NAME", NUM_ROWS, DISTINCT_KEYS "DISTINCT",
LEAF_BLOCKS, CLUSTERING_FACTOR "CF", BLEVEL "LEVEL",sample_size,LAST_ANALYZED,
AVG_LEAF_BLOCKS_PER_KEY "ALFBPKEY"
FROM DBA_INDEXES
WHERE OWNER = 'USER1' AND TABLE_NAME IN ('TB_1')
ORDER BY TABLE_NAME,INDEX_NAME;
SELECT INDEX_NAME "NAME", NUM_ROWS, DISTINCT_KEYS "DISTINCT",
LEAF_BLOCKS, CLUSTERING_FACTOR "CF", BLEVEL "LEVEL",sample_size,LAST_ANALYZED,
AVG_LEAF_BLOCKS_PER_KEY "ALFBPKEY"
FROM dba_ind_partitions
WHERE INDEX_OWNER = 'USER_1'
ORDER BY INDEX_NAME;
我之前查的sample_size是从这两个表出来的,都不正确。
distinct_keys的正确数值我是这样查的:
select count(*) from (select distinct index_col1 from tb_1 where index_col1 is not null)
表结构简单的如下:
QL>