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: mark <mark_brehmen_at_yahoo.com>
Date: 8 Nov 2001 20:42:33 -0800
Message-ID: <fa4781e4.0111082042.58b53819@posting.google.com>


I agree with you Thomas on why we need to use binds. Refer my earlier thread where i had mentioned that applications stop if they dont use binds.

"Dave Wotton" <Dave.Wotton_at_dwotton.nospam.clara.co.uk> wrote in message news:<1005173420.83664.1_at_eos.uk.clara.net>...
> "mark" <mark_brehmen_at_yahoo.com> wrote in message news:fa4781e4.0111062210.d4f590d_at_posting.google.com...
>
> [ snip advantages and disadvantages of bind variables, all of which I
> agree with. ]
>
> > 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.
> >
> > For repetitive operations, especially inserts, bind variables are an
> > absolute must.
>
> Most of the answers in this thread are correct, but this one sums
> it up best.
>
> A huge proportion of database statements (whether it's 80%, 90% or
> 99.999999% ) will benefit from using bind variables and only a
> small number of rare, pathological statements will be adversely
> affected by them. So the advice to programmers should be to use
> bind variables habitually unless you come across a specific instance
> where they cause a problem, then use other methods (eg. hard-coded
> values, histograms etc.)
>
> If you want some real statistics, take a look at my page:
>
> http://home.clara.net/dwotton/dba/java_insert.htm
>
> which (amongst other things) shows that not using bind variables for
> a simple insert statement makes it over twice as long to execute.
> And this is for a very simple insert of only 4 columns. I expect the
> performance to decrease more if more complicated sql statements need
> to be reparsed.
>
> A response degradation of 2x may not seem much, but if *all* your
> statements are taking twice as long as they should, your managers
> will soon be talking about buying new hardware, if you don't solve
> it by optimising your software.
>
> Dave.
Received on Thu Nov 08 2001 - 22:42:33 CST

Original text of this message

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