|
原帖由 棉花糖ONE 于 2009-12-28 19:30 发表 ![]()
那地方虽然显示的是基于高度的直方图,实际上应该是基于频率的,只是h.bucket_cnt > h.distcnt 把那个过滤,我觉得USER_TAB_COL_STATISTICS 的定义里应该把h.bucket_cnt > h.distcnt 改成h.bucket_cnt > =h.distcnt 更合适
I realize that ZALBB's test and mine later are very special in that there're only a few values in total, each distinct. ZALBB, you didn't say but I'm sure you only have 6 values, each distinct from each other. Correct? In this special case, if you specify more buckets than number of (distinct) values, Oracle will create only that many buckets, each containing one value which is distinct. *In this case, the definition of both frequency (FH) and height-balanced histogram (HBH) applies!* You can tell from the endpoint_number column of user_tab_histogram. If the numbers in this column represent the ordinal numbers of the buckets (i.e., starting from 1, then 2, 3, etc), it's an HBH. If they represent cumulative counts over previous buckets (or rows in this view query output), it's an FH. But in this case, it's both.
My conclusion is that this special histogram can be called either type. So whether you change > to >= in the view definition as you suggested makes no difference.
Yong Huang |
|