Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    190

    Unanswered: insert access plan

    Will db2 create an access plan when a dynamic insert statement is passed in ? Will the access plan stay in the package cache and be reused until the cache is flushed ?

    Thanks

  2. #2
    Join Date
    Nov 2011
    Posts
    334
    hi,
    Why do you think db2 will not create an access plan when excting a dynamic insert statment? I think for optimizer, there is no difference between insert statments and other statments ( select ,delete ,update ).

  3. #3
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    1,126
    A package will be created, but that package will not contain the access path (i.e., implementation details) for the INSERT statement; the INSERT statement will be optimized over and over again at each execution.
    Only with static SQL, the package contains a "real" access path.
    Dynamic access paths will remain in the statement cache for some time, of course. How long? That depends on the number of dynamic statements and the size of the cache.
    --_Peter Vanroose,
    __IBM Certified Database Administrator, DB2 9 for z/OS
    __IBM Certified Application Developer
    __ABIS Training and Consulting
    __http://www.abis.be/

  4. #4
    Join Date
    Nov 2011
    Posts
    334
    hi,
    I dont think the INSERT statement will be optimized over and over again at each exectuion。
    If the same insert statement executes more than one time, it will be optimized at the first execution。next time db2 will just pick up the access plan cached in package cache and execute it。

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •