----- Original Message ----- 
From: "Pierre Saint-Jacques" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 21, 2001 4:26 PM
Subject: Re: DB2EUG: Overhead for Dynamic SQL in UDB/AIX?


> Not only will the package cache be hit to insert the second statement 
> but the statement will also have to recompiled because the two strings 
> making the statements do not scan equal.
> Dynamic statements are stored in the cache in compiled versions and raw 
> sql versions. At next request, strings are compared. They will not be 
> equal so dB2 will recompile or reprpep the second one and insert it in 
> the cache taking twice the amount of space.

Is it just me or does this seem like something that could (should) be
enhanced in the optimizer?

With everything that the optimizer can do, it seems like a pretty trivial
task to replace actual values in a dynamic SQL statement with parameter
markers prior to compiling the access plan.

i.e.

     insert into x values (1,2);

could be rewritten as 

     insert into x values (?, ?);

before it's prepared / compiled.  This could really help Dynamic SQL 
applications such as the one that Bill wrote in about.


ian d. bjorhovde                       cephalad corporation
   [EMAIL PROTECTED]                   intelligent solutions for
      http://cephalad.com                    systems and data management



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

Reply via email to