Re: Vagaries of the CBO: Out-of-Range Predicates

  • From: "Anand Rao" <panandrao@xxxxxxxxx>
  • To: "Wolfgang Breitling" <breitliw@xxxxxxxxxxxxx>
  • Date: Tue, 19 Dec 2006 07:02:02 +0530

Hi,

Thanks Wolfgang, you are right i got a bit entangled in the terminology and
hence ended up formulating a wrong question.

Yes, selectivity is what i should be worried about and ultimately the cost
factor. because, i my case CBO is choosing the wrong index due to the NDV
being 1 and i don't have histograms.

so, looks like i have resign myself to the fact that an NDV hack is the only
way to make CBO choose the right index (without hinting the query).

many thanks,
anand




On 18/12/06, Wolfgang Breitling <breitliw@xxxxxxxxxxxxx> wrote:

 At 12:11 AM 12/18/2006, Anand Rao wrote:

adding one more question,

3) How does CBO calculate the density in cases of bind variables when the
value is out of range?

or is this a RTFM / RTFB ... ??


density is a "property" of the column and is roughly related to the
probability of finding a particular value in the rows of the table. It is
calculated when statistics are collected, *not* at parse time. density is
in no way dependent on bind variables - or literals for that matter. You may
be mistaking density with selectivity.

 Regards

Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com

Other related posts: