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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Step 3 is repeated <strong>for</strong> each master data table. A count should also be<br />

returned <strong>for</strong> the DSO table without any joins (and local predicates only), and<br />

finally a count of the total filtering from the entire query. These counts will be<br />

used to compare all filtering combinations. See Figure 10-7 <strong>for</strong> these counts.<br />

Step 4 - Compare with Actual Access Path<br />

Tables Accessed<br />

PDIVISION -<br />

AZ<strong>OS</strong>ASALE00<br />

SCO_AREA -<br />

AZ<strong>OS</strong>ASALE00<br />

SPROFIT_CTR -<br />

AZ<strong>OS</strong>ASALE00<br />

XZMATLPLNT -<br />

AZ<strong>OS</strong>ASALE00<br />

XZRLNSP -<br />

AZ<strong>OS</strong>ASALE00<br />

Count<br />

with<br />

Filtering<br />

12432<br />

1042733<br />

3164<br />

2264<br />

Figure 10-7 Compare with actual access path<br />

Final<br />

Filtering<br />

The original DSO table contains 7,084,349 rows. After local predicates are<br />

applied, the result is 1,042,733 rows, and the final count <strong>for</strong> the query<br />

including all filtering is four rows.<br />

4. Compare the filtering provided by each master data table joined to the DSO.<br />

In this example we can see that SCO_AREA provides no filtering (because<br />

the count equals the count of local DSO predicates only), but all other master<br />

data tables provide strong filtering. It is clear, however, that XZMATLPLNT<br />

joined to AZ<strong>OS</strong>ASALE00 provides the strongest filtering (8 rows returned,<br />

when the entire query only returns 4 rows).<br />

Any indexing, clustering, and partitioning decisions should take into<br />

consideration the patterns of all queries against the DSO (if possible), although<br />

— <strong>for</strong> this example only — the decisions should be made to support a table join<br />

sequence of table XZMATLPLNT accessed first, and joined to AZ<strong>OS</strong>ASALE00.<br />

210 <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><br />

8<br />

4<br />

4<br />

4<br />

4<br />

4<br />

ODS table 7,084,349.<br />

After local predicates<br />

1,042,733 (14.7%)<br />

No Filtering<br />

2 table count is closest<br />

to the final count

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

Saved successfully!

Ooh no, something went wrong!