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.

This step involves breaking apart the original query to count the number of<br />

rows retrieved <strong>for</strong> each master data table joined to the central ODS table.<br />

Include the local predicates <strong>for</strong> the tables in the join on the count SQL<br />

statement. Figure 10-6 shows the SQL count statement and the returned<br />

count <strong>for</strong> the PDIVISION/AZ<strong>OS</strong>ASALE00 join relationship.<br />

Step 3 - Determine the Filtering<br />

Count<br />

-------<br />

12432<br />

SELECT COUNT(*)<br />

FROM "/<strong>BI</strong>0/PDIVISION" "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"<br />

WHERE "/<strong>BI</strong>C/AZ<strong>OS</strong>ASALE00"."/<strong>BI</strong>C/ZA_SADIV" = "/<strong>BI</strong>0/PDIVISION"."DIVISION"<br />

AND "/<strong>BI</strong>0/PDIVISION"."OBJVERS" = 'A'<br />

AND "/<strong>BI</strong>0/PDIVISION"."/<strong>BI</strong>C/ZREPTDIV" = '5X'<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 />

Figure 10-6 Determine the filtering<br />

PDIVISION<br />

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

Shows the effect of<br />

PDIVISION filtering<br />

against the fact<br />

table<br />

This count demonstrates that the combined filtering of local predicates on the<br />

PDIVISION and AZ<strong>OS</strong>ASALE00 tables return 12,432 rows. This is<br />

considered considerable filtering, given that the original DSO table has 7<br />

million rows.<br />

Chapter 10. Tips <strong>for</strong> SQL efficiency 209

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

Saved successfully!

Ooh no, something went wrong!