Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Density calculation. Was: Incorrect cardinality estimate
For a height-balanced histogram the (non-null) column values are
sorted and then "filled" into buckets of num_non_null_rows/buckets
rounded (most likely up) to an integer. Then the first value, the
highest value in each bucket, and the last value are recorded.
Popular values are those that occur as the highest value in more than
one (consecutive) bucket. If we let sz = size of each bucket (except
perhaps the last) then a popular value occurs at least sz+1 times -
once as the highest value in bucket n-1 and then filling the entire
bucket n, thus being recorded as the highest value of two buckets,
n-1 and n. What can (and does) happen is that a value that occurs
2*sz-1 times may not be recognized as a popular value even though
2*sz-1 > sz+1 ( except for sz=1 but that would be a frequency
histogram and sz=2 where they are equal). That happens if the value
starts in and fills bucket n and fills n+1 up to the last spot which
will be occupied by the next higher value. Thus the value appears at
only one endpoint and is classified non-popular.
At 05:34 AM 1/25/2007, Laimutis Nedzinskas wrote:
>Ok then, Oracle is adjusting density by deviation.
>
>The question is how Oracle decides unpopular values.
>Calculations show that the decision is discrete:
>The value is either in or out, there appears to be no weighting factor.
Regards
Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Jan 25 2007 - 08:19:35 CST
![]() |
![]() |