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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: CBO Predicate selectivity

Re: CBO Predicate selectivity

From: Alex Gorbachev <gorbyx_at_gmail.com>
Date: Thu, 13 Jul 2006 10:30:37 +0200
Message-ID: <c2213f680607130130j5de9ed52x489bc81106d5d6d@mail.gmail.com>


I didn't see which Oracle version it is but if it's 10g than SQL Profile might be the good choice.

> Until 10g, the optimizer does not peek at values for this
> query - it uses the standard col >/< :bind algorithms which
> basically means the predicate has a selectivity of 0.25%
> (5% of 5%).
>
> > - "where date between to_date(:b1) and to_date(b2)"
>
>
> You say you can't change the query, so if you want to
> fake this query, you probably need to use dbms_stats.set_table_stats
> to tell Oracle that the table has a very small number of rows -
> but don't change the block count - so that a properly calculated
> selectivity is fooled into getting the right cardinality. Then capture
> the execution plan in a stored outline - and put the stats back to
> normal.

-- 
Best regards,
Alex Gorbachev

http://blog.oracloid.com
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jul 13 2006 - 03:30:37 CDT

Original text of this message

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