Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Explain Plan with BIND Variables
Two questions about bind variables and execution plans
Question 1
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 Received on Wed Mar 22 2000 - 00:00:00 CST
![]() |
![]() |