Canberra DB2 User Group

Find scans

 

I wrote this as a training example for CASE statements but it could be used a s a model for identifying poor access paths .

Basically the plan table is retrieved with columns expanded to English words and asterisks added on items you may wish to check.

Here is an extract of the output:

     BAA_TABLE_EXAM      *Tablespace scan            *00    index & data  *Seq pref
     BAA_TABLE_EXAM      *Tablespace scan            *00    index & data  *Seq pref
     BAB_TABLE_XMPLE_2    Index access       XBAB1    04    index & data
     BAA_TABLE_EXAM       Index access       XBAA2    04    Index only
     BAA_TABLE_EXAM       Index access       XBAA2    04    index & data  *List pre
     BAB_TABLE_XMPLE_2   *Mult IX scan next          *00    index & data  *List pre
     BAB_TABLE_XMPLE_2   *Mult IX/read IX    XBAB3    03    Index only
     BAB_TABLE_XMPLE_2   *Mult IX int.               *00    index & data 

As you can see, asterisks have been placed next to items of possible interest such as scans, matchcols=0 and so on. THis is not exhaustive and can be easily amended to do more. For exampl you could join with the catalog to get table and/or index stats.

About Us | Site Map | Privacy Policy | Contact Us | ©2007 Stevets Pty