Re: Ignore histograms on sql level

From: Sayan Malakshinov <xt.and.r_at_gmail.com>
Date: Wed, 20 Jan 2021 02:00:35 +0300
Message-ID: <CAOVevU7F5JhC5ms3xFbrnDsOSYQq==L8kppObWvzJ87vL7fXPA_at_mail.gmail.com>



Hi Mladen,

Just look at the cardinality column: you will see E-rows=10 (estimated rows) in the first example, which means CBO used histograms, and 222 for both: 2nd example (with bind variable, ie without histograms) and 3rd - hinted one.

"Size 255" just sets *maximum* number of buckets. I just was lazy to count, so I've set obviously bigger value. As you can see in the full example, there were 5 buckets (5 distinct-values)

PS. Yeah, Jonathan is a very kind person! I also got signed books and even photos :)

Pps. Sorry for any typos, sent from my phone...

Best regards,
Sayan Malakshinov
Oracle performance tuning expert
Oracle Database Developer Choice Award winner Oracle ACE Associate
http://orasql.org

ср, 20 янв. 2021 г., 1:46 Mladen Gogala <gogala.mladen_at_gmail.com>:

> On 1/19/2021 5:27 PM, Sayan Malakshinov wrote:
> > Hi listers,
> >
> > Jonathan is absolutely correct as always - we can easily get it using
> > the following format:
> > column_stats("OWNER"."TABLE", "COLUMN", scale, length=NN distinct=NN
> > nulls=NN min=NN max=NN)
> >
> Sayan, I don't understand the example. Plan hasn't changed, how do you
> know that histograms weren't used with the hint? You created the
> histograms of size 255 but I don't see whether they're used or not. BTW,
> I don't doubt the word of Jonathan, I'm no heathen.I am an admirer. One
> of the two times I've met him in person, I asked him to sign his 8i
> book. You'd be surprised, that 8i book is still mostly relevant.
>
> --
> Mladen Gogala
> Oracle DBA
> Tel: (347) 321-1217
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jan 20 2021 - 00:00:35 CET

Original text of this message