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: Bind Variable Peeking

Re: Bind Variable Peeking

From: Alex Gorbachev <gorbyx_at_gmail.com>
Date: Tue, 21 Nov 2006 23:55:16 -0500
Message-ID: <c2213f680611212055o63765ea8nad95fc6b567bdc6f@mail.gmail.com>


[repost due to over-quote]

If Jonathan reads your question than he would probably give you the answer right away...

But I'm a mere mortal so just few tips in the order of precedence I would look at them:

Hope this can get you started.

On 11/21/06, Ray Feighery <rjfeighery_at_gmail.com> wrote:
> 9.2.0.6 <http://9.2.0.6>
> Solaris 8
>
> Bind Variable peeking is supposed to look inside the bind variables when
> the query is first run (hard parsed). Yet when I run a query with
> exactly the same values I get different execution paths between the
> literal and bind variable statements.
> This is after the shared pool has been flushed (tkprof confirms a
> library cache miss). The key difference in the execution plans is that
> with literal values the optimizer can resolve the inlist to access
> ("X"."PARENT_ID"=(-1) OR "X"."PARENT_ID"=21971987), but the bind
> variable version is split into 50 OR statements.
>
> I've analyzed the table and there shouldn't be any histograms. Plans are
> generated from v$sql_plan.
>
> Any ideas why there is a difference? It causes a huge difference in time
> (from 0.68s to 9.49s).
>
> I "solved" the problem using a stored outline, but I still do not
> understand why a different execution plan is generated between bind
> variables and literals.

-- 
Best regards,
Alex Gorbachev

The Pythian Group
Sr. Oracle DBA

http://www.pythian.com/blogs/author/alex/
http://blog.oracloid.com
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Nov 21 2006 - 22:55:16 CST

Original text of this message

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