Ian D. Bjorhovde wrote:

> ----- Original Message ----- 
> From: "Juan Lanus" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 21, 2001 9:02 AM
> Subject: Re: DB2EUG: Overhead for Dynamic SQL in UDB/AIX?
> 
> 
> 
>> Hi, Bill
>> 
>> Please let me throw two ideas I'm sure you are already aware of:
>> 
>> 1- DB2 caches dymanic SQL statements. The great advantage of those 
>> parameter markers is that they help the optimizer to recognize repeating 
>> statements even with different data.
> 
> 
> Juan,
> 
> For the following two statements:
> 
> update mytable set (a,b,c,d,e) = (1,2,3,4,5) where f = 1;
> update mytable set (a,b,c,d,e) = (6,7,8,9,0) where f = 2;
> 
> Are you saying that, (without using parameter markers), DB2 should 
> get a hit in the package cache for the second statement?

No, I think you have to use parameters. That each new statement has to 
be textually identical to the cached one.
Also, I think that SQLs like "SELECT * FROM t WHERE k BETWEEN ? AND ?" 
will be optimized each time, fortunately.

What I'm trying to communicate is that with a few changes, your app 
might behave closer to a binded app.
By selecting the few most used sentences and "parameterizing" them.

Regards--
Juan Lanus
TECNOSOL


=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

Reply via email to