Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question about DBMS_STATS and Histograms
rgaffuri_at_cox.net (Ryan Gaffuri) wrote in message news:<1efdad5b.0305060637.1334f3ca_at_posting.google.com>...
> I checked on Asktom and I understand how histograms work and what they
> are from college level statistics. However, Im having trouble
> calculating my 'N' buckets. Anyone have a short and dirty method for
> estimating this or a link to one? Couldn't find any general rules of
> thumb on Asktom.
>
> Ryan
I doubt that there is an easy mean of dertermining the optimal bucket size. ORACLE would have done it for you, I would think, if such mean exists. It takes expementations - ORACLE's own DOC says so. You want "enough" buckets to capture the distribution of the data accurately, but on the other hand, you don't want to create too many buckets as they add overhead. Best thing you can hope for seems to be that there are not too many distinct values in your table. If you create more buckets than the number of distinct values in the columns in question, value-balanced histograms will be created. In this case, relatively few buckets will have been created and the selectivity of each and every value can be precisely determined for the optimiser to take advantage of.