dba_tab_col_statistics
根据yuang hong的文章,9i中无上述视图,不过可以从dba_tab_col_statistics 视图的代码中得知可用下面的语句查看 9i的histogram type (注:10g与9i中histogram无大的变化).
注意xxx_tab_col_statistics中的column statistics和histogram infomation均取自ALL_TAB_COL_STATISTICS provides column statistics and histogram information
extracted from "ALL_TAB_COLUMNS" on page 2-124.
所以,<
select case when nvl(h.row_cnt,0) = 0 then 'NONE'
when (h.bucket_cnt > 255
or
(h.bucket_cnt > h.distcnt and h.row_cnt = h.distcnt
and h.density*h.bucket_cnt*2 <= 1))
then 'FREQUENCY'
else 'HEIGHT BALANCED'
end
from sys.hist_head$ h
where obj# = &object_id_for_the_table;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/94384/viewspace-600297/ ,如需转载,请注明出处,否则将追究法律责任。