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: Explain Plan with BIND Variables

Re: Explain Plan with BIND Variables

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: 2000/03/23
Message-ID: <38D9EE17.7E70@yahoo.com>#1/1

Stephan Schaefer wrote:
>
> Two questions about bind variables and execution plans
>
> Question 1
> =================================================================
> How can I see the execution plan for the following statement:
>
> select * from my_table where column1 = :my_value ;
>
> Within SQL*Plus I cannot enter
> explain plan set statement_id = 'my_id' for
> select * from my_table where column1 = :my_value ;
>
> And my precompiler tells me:
> "PCC-S-02206, Host variables are not permitted within a DDL statement"
>
> HP-UX 10.20, oracle 7.3.3.6
>
> Question 2
> =================================================================
>
> oK: The explain plan should be identical with the statement
> "select * from my_table where column1 = 123"
>
> Usually it is. But we have one table (1.5 GB large) and one statement
> where the optimizer decides to take different indexes using binds or
> not!!!!
>
> In this case running the readable statement within SQL*Plus takes 5
> seconds, and the analogue statement with bind variables takes 30
> Minutes...
>
> Is this normal? Has anyone seen a analogue behavior?
>
> Stephan Schaefer
>
> mailto:stesch_at_camline.com

That is strange - we regularly run explain plan with the 'abstract' bind variable references ":b1" etc etc with no problems...

This is via SQL Plus and/or Toad

HTH

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Thu Mar 23 2000 - 00:00:00 CST

Original text of this message

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