Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: There is NOT value in using BOUND variables!!! ???
"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