IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Explain Report


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
minakshi

New User


Joined: 02 Oct 2007
Posts: 7
Location: Delhi

PostPosted: Fri Jan 25, 2008 10:14 pm
Reply with quote

Please update me on Explain reports and the process.

Thanks!
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Jan 25, 2008 10:47 pm
Reply with quote

Have you checked the manuals? They detail the output of EXPLAIN and what each column means.
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Fri Jan 25, 2008 11:10 pm
Reply with quote

EXPLAIN basically used to get the access path info that is being used in bind process. the process is before you run EXPLAIN you need to have a PLAN TABLE(might be prod, test, or your own).
Code:
SELECT PARALLELISM_MODE,                                         
       TSLOCKMODE, MATCHCOLS, ACCESSNAME, INDEXONLY, ACCESSTYPE 
     , METHOD, TNAME, PREFETCH                                   
     , SORTN_UNIQ||' '||SORTN_JOIN||' '||SORTN_ORDERBY||' '||   
       SORTN_GROUPBY                                             
     , SORTC_UNIQ||' '||SORTC_JOIN||' '||SORTC_ORDERBY||' '||   
       SORTC_GROUPBY                                             
     , COLUMN_FN_EVAL, PROGNAME                                 
     , SUBSTR(TIMESTAMP,5,2)||'/'||SUBSTR(TIMESTAMP,7,2)||'/'|| 
       SUBSTR(TIMESTAMP,3,2)||' '||SUBSTR(TIMESTAMP,9,2)||':'|| 
       SUBSTR(TIMESTAMP,11,2)                                   
     , QUERYNO, QBLOCKNO, PLANNO, MIXOPSEQ, SUBSTR(COLLID, 3, 2)
  FROM AUTHD6$1.PLAN_TABLE                                       
    WHERE PROGNAME          = 'JDBB8900'                         
      AND DATE(BIND_TIME)  >= '2008-01-20'                       
  ORDER BY QUERYNO ASC, QBLOCKNO, PLANNO, MIXOPSEQ;             


Besides SPUFI and other interactive tools, you can also achieve this through a batch job like
Code:

//STP1     EXEC EXPLAIN,                       
//             SOUT='H',                       
//             INPUT='DJD0B.AUTH.RPTSQL(TEST2)'
//                                             

Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Jan 25, 2008 11:14 pm
Reply with quote

Explain is much more than what happens in the bind process. It analyzes the access path for any query. It also gives indications about how the query will perform when executed. This can identify un-optimized SQL or SQL that forces a full table scan, or doesn't use indexes when doing a query, etc
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts DB2 Statistics - Using EXPLAIN and qu... DB2 1
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
No new posts Report of batch jobs JCL & VSAM 1
Search our Forums:

Back to Top