07.02.2013 Views

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

Best Practices for SAP BI using DB2 9 for z/OS - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AND "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."PLANT" = "/<strong>BI</strong>C/XZMATLPLNT"."PLANT"<br />

AND "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."ACCNT_ASGN" IN ('00', '01', '04', '06')<br />

AND "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."CALMONTH" BETWEEN '200311' AND '200404'<br />

AND "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."CURTYPE" = 'B0'<br />

AND "/<strong>BI</strong>C/XZMATLPLNT"."OBJVERS" = 'A'<br />

AND "/<strong>BI</strong>C/XZMATLPLNT"."S__ZMATLONLY" = 360013<br />

The join sequence that we wish to encourage is table /<strong>BI</strong>C/XZMATLPLNT<br />

accessed first, and joined to /<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00. There<strong>for</strong>e, local predicates on<br />

the /<strong>BI</strong>C/XZMATLPLNT should be indexed to encourage this as the leading table<br />

to be accessed.<br />

AND "/<strong>BI</strong>C/XZMATLPLNT"."OBJVERS" = 'A'<br />

AND "/<strong>BI</strong>C/XZMATLPLNT"."S__ZMATLONLY" = 360013<br />

Note that the OBJVERS column has only one possible value, and there<strong>for</strong>e does<br />

not provide any filtering. The only reason to add this to the index is if index-only<br />

access is desired.<br />

Table 10-1 Index recommendation<br />

The index recommendation <strong>for</strong> table /<strong>BI</strong>C/XZMATLPLNT is shown in Table 10-1.<br />

Column Reason<br />

S__ZMATONLY Required to support local filtering<br />

/<strong>BI</strong>C/ZMATLPLNT Optional to support additional joins (see 10.3.1, “Index design <strong>for</strong><br />

post-DSO access” on page 223)<br />

PLANT Optional to support additional joins (see 10.3.1, “Index design <strong>for</strong><br />

post-DSO access” on page 223)<br />

Only local predicates are available as index matching on the leading table<br />

accessed. Join predicates are not. Thus the index design <strong>for</strong> <strong>BI</strong>C/XZMATLPLNT<br />

incorporates the local predicate first.<br />

The join predicates are not valid as filtering predicates on the leading table (since<br />

the join value is not known when the first table is accessed), but they do provide<br />

filtering if this table is ever chosen as a non-leading table in the join sequence.<br />

The join predicates in the index ensure that the subsequent table accessed will<br />

be joined in the sequence of the index, which can improve sequential retrieval <strong>for</strong><br />

the non-leading table data.<br />

To support /<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00 as the second table in the join sequence, the<br />

following predicates must be considered:<br />

WHERE "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."/<strong>BI</strong>C/ZMATLPLNT" =<br />

"/<strong>BI</strong>C/XZMATLPLNT"."/<strong>BI</strong>C/ZMATLPLNT"<br />

AND "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."PLANT" = "/<strong>BI</strong>C/XZMATLPLNT"."PLANT"<br />

220 <strong>Best</strong> <strong>Practices</strong> <strong>for</strong> <strong>SAP</strong> <strong>BI</strong> <strong>using</strong> <strong>DB2</strong> 9 <strong>for</strong> z/<strong>OS</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!