If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Access path problems

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-06, 06:36
kartic_s kartic_s is offline
Registered User
 
Join Date: Jun 2006
Posts: 8
Access path problems

We have a problem in choosing the Access path like if we execute from spufi, it takes one Access path that is actually good one which takes few seconds to retrieve the datas , but if we execute from Application program it takes some other Access path and it's relatively very small.

This was happened after REORG and also the version change..

the below is the SQL Statements,


EXEC SQL DECLARE A CURSOR FOR
SELECT A.LOCAL_REF_NUMBER
, A.FORM_NR
, A.BRIEF_DESCRIPTION
, A.ISSUE
, A.PRIORITY
, A.AUTHOR
, A.AUTHOR_EXT
, A.AUTHOR_DEPT
, F.NEXT_NODE
, B.DATE
, B.NODE_NAME
, F.DUE_DATE
, C.ACTION_NAME
, C.ROUTING_STATUS
, A.AUTHOR_LOC
, A.APPLICATION_ID
, A.FORM_TYPE
, A.COMPANY_CODE
, A.FORM_NUMBER
, A.SUBFORM_MODE_FLAG
, F.SUBFORM_NUMBER
, F.SUBFORM_ITEM
, F.FORM_CONDITION
FROM C#FORM_TABLE_09 A
, C#HISTORY_07 B
, C#ACTIONS_07 C
, C#FORM_TYPES_07 D
, C#FORM_STATS_02 F

WHERE D.FORM_TYPE_NAME BETWEEN T1
AND T2
AND D.APPLICATION_ID BETWEEN :LOW_APPL
AND :HIGH_APPL
AND F.APPLICATION_ID = D.APPLICATION_ID
AND F.FORM_TYPE = D.FORM_TYPE
AND F.INACTIVE_CTR = 0
AND F.NEXT_NODE = :NODE#
AND A.FORM_TYPE = F.FORM_TYPE
AND A.COMPANY_CODE = F.COMPANY_CODE
AND A.FORM_NUMBER = F.FORM_NUMBER
AND A.APPLICATION_ID = F.APPLICATION_ID
AND B.FORM_TYPE = A.FORM_TYPE
AND B.COMPANY_CODE = A.COMPANY_CODE
AND B.FORM_NUMBER = A.FORM_NUMBER
AND B.SUBFORM_NUMBER = F.SUBFORM_NUMBER
AND B.APPLICATION_ID = A.APPLICATION_ID
AND B.SEQUENCE_NUMBER = F.STATUS_SEQ_NR
AND C.FORM_TYPE = B.FORM_TYPE
AND C.ACTION_NUMBER = B.ACTION_NUMBER
AND C.APPLICATION_ID = B.APPLICATION_ID
FOR FETCH ONLY;


Could you please check the above query which table should Access first whether it's bigger ones or smaller ones?

Please give me your valuable suggestions in this regard.

Regards,
karthik
Reply With Quote
  #2 (permalink)  
Old 10-24-06, 09:26
urquel urquel is offline
Registered User
 
Join Date: Aug 2004
Posts: 330
I had a similar problem with SPUFI giving me an access path with good performance and the stored procedure choosing poorly. I ended up using an optimization hint with the access path from the SPUFI.
Reply With Quote
  #3 (permalink)  
Old 12-15-06, 01:31
kartic_s kartic_s is offline
Registered User
 
Join Date: Jun 2006
Posts: 8
Dynamic SQL

Like you suggested i have used opt hint, but not worked. Can i use the dyanamic SQL inside the PL/I programme to get rid of the Access path problems.

PLease assist me.

Regards,
karthik
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On