|
本帖最后由 Yong Huang 于 2012-9-7 10:25 编辑
> 那一般收集统计的时候,method_opt =>'for all columns size auto',使用这个方法,是不是一个列的唯一值超过254个值,就是等高直方图,不超过254,就是等频直方图呢...
The type of a histogram is determined by not just the number of distinct values, but also the number of buckets. But I don't know the algorithm of that "size auto" in terms of how many buckets it creates.
I checked the definition of xxx_tab_col_statistics in 10g to see how it determines which of the two types of histogram. See part 2 of
http://yong321.freeshell.org/oranotes/Histogram.html
Although documentation says "Frequency histograms are automatically created instead of height-balanced histograms when the number of distinct values is less than or equal to the number of histogram buckets specified", I see no way to create a histogram with >= 255 buckets. So, if you have >= 255 distinct values, your bucket count is definitely smaller and therefore the histogram is definitely height-balanced. But if you have < 255 distinct values, either type is possible. |
|