about histogram(2)

tengrid發表於2009-05-18

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部落格 ” ,連結:http://blog.itpub.net/94384/viewspace-600297/,如需轉載,請註明出處,否則將追究法律責任。

相關文章