Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: CBO histograms and bind variable

Re: CBO histograms and bind variable

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 12 Oct 2003 10:56:40 +0100
Message-ID: <bmb8fc$3s8$1$8300dec7@news.demon.co.uk>

There is also one little detail that is often overlooked. When you generate a 'useful' histogram, it changes the DENSITY on the user_tab_column - which has the effect of changing the column selectivity on an equality. So even with "unpeeked" bind variables, a histogram could have some effect in earlier versions of Oracle

--
Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

  The educated person is not the person
  who can answer the questions, but the
  person who can question the answers -- T. Schick Jr


One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html
____Iceland__November (tbc)
____Belgium__November (EOUG event)
____UK_______December (UKOUG conference)


Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html
____USA__October
____UK___November


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


"Ryan Gaffuri" <rgaffuri_at_cox.net> wrote in message
news:1efdad5b.0310111659.53e0c2df_at_posting.google.com...

> Sybrand Bakker <gooiditweg_at_sybrandb.nospam.demon.nl> wrote in
message news:<vfkgov4dobcrjehd2lgamq57899vdckj6v_at_4ax.com>...
> > On Sat, 11 Oct 2003 21:33:32 +0300, "Jarmo Blomster"
> > <jarmo.blomster(RMVE.N0SPM)@mbnet.fi> wrote:
> >
> > >Hi,
> > >
> > >Can Oracle CBO utilize histograms when I use bind variables in
SQL-query?
> > >Is there differences between versions 8 and 9?
> > >
> > >//jarmo
> > >
> >
> > CBO doesn't use histograms in version 8i. CBO should be capable to
> > 'peek' in bind variables in 9i
> >
> This is not perfect. per kytes new book, if you use bind variables
the
> query will be parsed once. This means if you have a skewed data set
> and have histograms, the histograms will be used the FIRST time when
> the sql query is parsed to build the execution plan, but will not
use
> them again. This is because the execution plan is already parsed.
>
> is this accurate?
Received on Sun Oct 12 2003 - 04:56:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US