19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - 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.

V8 shows that PL is joined with CV also using nested loop join method. But the sequence is<br />

different. Both tables are accessed via a one-column matching index only scan, but the<br />

access path in V8 is more efficient.<br />

Other measurement indicators are listed in Table 3-2.<br />

Table 3-2 Measurements <strong>for</strong> mismatched numeric data types<br />

Measurement V7 V8 Delta<br />

Elapsed time in sec. 7.9 1.4 -82%<br />

CPU time in sec. 5.8 0.3 -95%<br />

Work file getpages 0 0 0<br />

Data getpages 77 43 -44%<br />

Index getpages 2558 8 -99.7%<br />

Matching index 1 2 100%<br />

Mismatched string data types<br />

This measured query is a join of two tables where the local predicates have different lengths<br />

as shown in Figure 3-28.<br />

Figure 3-28 Different lengths <strong>for</strong> string data type<br />

The predicate comparing strings of different length becomes stage 1, and then the <strong>DB2</strong><br />

Optimizer changes the sequence of tables in the join to do an earlier filtering, resulting in<br />

better per<strong>for</strong>mance.<br />

70 <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Per<strong>for</strong>mance <strong>Topics</strong><br />

Different length <strong>for</strong> string data type<br />

SELECT BRN.REG,PLC.POL,LEN,PLC.BRA,<br />

CMA.SUR,TRC,CST,COV.CVI,LPC,CSC,CVT<br />

FROM BRN,PLC,COV,CIA,CMA,CLB,CCT,CAG<br />

WHERE PLC.BRN = BRN.BRN<br />

AND PLC.POL = COV.POL<br />

AND PLC.POL = CIA.POL<br />

AND PLC.POL = CAG.POL<br />

AND COV.POL = CIA.POL<br />

AND COV.POL = CAG.POL<br />

AND COV.CVI = CIA.CVI<br />

AND CIA.CLI = CLB.CLI<br />

AND CAG.CMA = CMA.CMA<br />

AND COV.CVC = CCT.CVC<br />

AND CST = 'MAILD ' /* CHAR(5) CHAR(6) */<br />

AND COV.CVT IN ('A ','B ','G ','P ')<br />

ORDER BY REG,PLC.POL,PLC.BRN,SUR;<br />

V7 PLAN_TABLE<br />

IXNAME METHOD MATCHCOL<br />

COVIX<br />

PLCIX<br />

0<br />

1<br />

V8 PLAN_TABLE<br />

IXNAME METHOD MATCHCOL<br />

CCTT<br />

COVIM<br />

0<br />

1<br />

0<br />

1<br />

0<br />

1<br />

12<br />

10<br />

8<br />

6<br />

4<br />

2<br />

0<br />

9.6X<br />

V7 DEGREE(1)<br />

V8 DEGREE(1)<br />

40 X<br />

Elapsed sec CPU sec

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

Saved successfully!

Ooh no, something went wrong!