Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: CBO Predicate selectivity
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-lReceived on Thu Jul 13 2006 - 03:30:37 CDT
![]() |
![]() |