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: Bind Variables...

Re: Bind Variables...

From: Nuno Souto <nsouto_at_optushome.com.au.nospam>
Date: Wed, 07 Nov 2001 12:57:15 GMT
Message-ID: <3be92e56.3775416@news>


In a valiant and sublime effort,mark
frowned, dipped a thumb in soot and doodled:

>
>As a good enough thumb rule, if you have a statement which executes
>once or very few times and response times are good, avoid bind
>variables.

I'd go along with this too. Had too many problems with the optimizer substituting wrong weights for bind variables to even consider otherwise.

Once off or seldom executed statements, particularly ones that involve lots of tables in weird joins and/or large return sets will do much better without bind variables. Not because bind variables are wrong per se, but because you reduce the risk of the optimizer taking a wrong decision.

>
>For repetitive operations, especially inserts, bind variables are an
>absolute must.

Exactly. Statements that get executed thousands of times a day are the ones that benefit from bind vars. They are usually simple statments anyway, so there is very little chance of the optimizer going South on them.

>
>I do not know what placeholders are . sorry.
>

&var.
As in SQL*Plus, when you type:
where col1 = '&value'
and it asks you to enter value, then substitutes the string you type in the statement and _then_ runs it.

Cheers
Nuno Souto
nsouto_at_optushome.com.au.nospam Received on Wed Nov 07 2001 - 06:57:15 CST

Original text of this message

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