MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REOPT VARS, SYSPACKDEP, USAGE of index

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Oct 14, 2004 4:32 am    Post subject: REOPT VARS, SYSPACKDEP, USAGE of index Reply with quote

Hi,

I have the problem to find out, which indices are unused or wether changes to an Index (DROP Index and (RE-)CREATE INDEX with additional fields) will effect any DB2 packages.

Fact is: The usage of an index in an special package is stored in DB2 Catalog, table SYSPACKDEP.

What will happen, if packages are bound with REOPT VARS ?

In this situation DB2 may choose an other access path during runtime than at bind time selected.

I'm now not sure about the content of SYSPACKDEP.

Is ist possible, that DB2 chooses at runtime of an package, bound with REOPT VARS parameter, an index, with is not stored in SYSPACKDEP during bindtime ?

If so, this means: If an index can'n be found in SYSPACKDEP, the index is not used in packages bound without REOPT VARS, but may be used in packages bound with REOPT VARS.

Who can pls. clearify the situation ?

regards,
bauer
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Oct 14, 2004 5:37 am    Post subject: Reply with quote

bauer,

Hmmm as far as I remember REOPT(VARS) is only valid for dynamic sql. anyway check these links

REOPT(VARS)

How bind option REOPT(VARS) affects dynamic SQL

Using REOPT(VARS) to change the access path at run time

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Oct 14, 2004 7:15 am    Post subject: Reply with quote

Hi Kolusu,

thank you for your qick reply.

We uses reopt(vars) with static sql (for only some special queries (*)). This works perfect. Yours links are known to me.

But what about the content of sysibm.syspackdep. Is the content only the indizes used at bind time ? What about indizes used at runtime, because of reopt (vars) finds out an better access path ?

regards,
bauer








(*) Queries to select for example order number, with various inputs / input cominations like order number, order adress, partnumber, delivery date etc. We use one join for all tables, several where clauses. Lokks like this:

select ..... from table1, table2, table3 ......... where order number like :HOSTVAR1 and part number like :HOSTVAR2 and .......

Using REOPT (VARS) the DB2 systems checks content of HOSTVAR1, HOSTVAR2 ...... and select is performed using index for ordernumber, or partnumber ......

Advantage: Not a lot of numbers for special cursors for each request, all combinations of search fields are possible

Disadvantage: CPU Time for reopt vars at runtime
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Mon Oct 18, 2004 4:28 am    Post subject: Reply with quote

Hello Bauer,

the entries in SYSPACKDEP reflect the results of the optimize step during bind processing (as stored in PLAN_TABLE). With reopt vars you ask for a re-optimization at runtime, which of course could temporarily alter the access path.

Therefor entries in SYSPACKDEP are only a hint for a physical db designer, since access paths for dynamic SQL are'nt recorded there anyway.

regards
Christian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group