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: autotrace issue

Re: autotrace issue

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Fri, 14 Oct 2005 12:49:08 +0000
Message-Id: <1129294148l.5813l.0l@medo.noip.com>

On 10/14/2005 08:23:50 AM, Yasin Baskan wrote:
>
>
> Sure it will reuse the same plan for a sql statement with bind
> variables. But it does not use the same plan for sqls with literals.

Of course it doesn't reuse the same plan.

>
> Select * from <table>
> Where col1=1;
>
> Select * from <table>
> Where col1=2;

Those are two completely different SQL statements, related as much as a T-Rex and a hummingbird. You can force the connection by setting cursor sharing to force. I'm actually very interested in that. Cursor sharing didn't work in 8i, it didn't work in 9i and I'd like someone else to try it in production in 10g first. I'd be in your dept if you decide to do so. May the force of the cursor sharing be with you.

>
> The optimizer can give 2 different plans for these sqls (according to
> the statistics of course). I was talking about sqls with literals as the
> sqls in the question.

Because optimizer will check histograms. The distribution of values may warrant 2 different plans.

-- 
Mladen Gogala
http://www.mgogala.com


--
http://www.freelists.org/webpage/oracle-l
Received on Fri Oct 14 2005 - 07:52:55 CDT

Original text of this message

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