Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: There is NOT value in using BOUND variables!!! ???

Re: There is NOT value in using BOUND variables!!! ???

From: Erwin Dondorp <erwindon_at_wxs.nl>
Date: Thu, 11 Nov 1999 22:33:47 +0100
Message-ID: <382B363B.32992782@wxs.nl>


"Kevin P. Fleming" wrote:
> But, bind variables _can_ have a negative performance impact, when the same
> statement is used with two different sets of values that would lead to
> different execution plans... if the statements are coded with literal
> values, the optimizer can use those values (and look at histograms) to
> determine the best execution path, but when it compiles a statement with
> bind variables, it has to use a "best guess" execution path.
>
> Think of a table with 100 records for customer ABC, and 15,000 records for
> customer DEF, out of a total of 200,000 records. A query for all records for
> ABC would likely use an index on the customer id as the fastest path, but
> the query on DEF would likely use a full table scan. But if the query is
> done using bind variables, only one path will be used for both queries.
>
> Erwin Dondorp <erwindon_at_wxs.nl> wrote in message
> > Bound variables should never have a lower performance as far as I know.

Hmmm, I forgot about that.

Thanks

--
Erwin Dondorp
<http://www.dondorp.com/> Received on Thu Nov 11 1999 - 15:33:47 CST

Original text of this message

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