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

Create successful ePaper yourself

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

3.6.2 Conclusion<br />

Figure 3-33 Query parallelism in V8<br />

Queries involving joins using MCSMJ (the method is likely to be used when the result set<br />

tends to be large) can have benefits because of access path enhancements due to better<br />

filtering when multiple columns are used as predicates.<br />

Enabling query parallelism in long running queries can give extra improvement in elapsed<br />

time, but generally an increase in CPU time.<br />

3.6.3 Recommendations<br />

Query parallelism in V8<br />

SELECT COUNT(*) FROM P,PX<br />

WHERE P.KEY < 1000<br />

AND P.BD_C20=PX.BD_VC20<br />

AND P.CT_C10 = PX.CT_VC10;<br />

Data type of P.BD is CHAR(20)<br />

Data type of P.CT is CHAR(10)<br />

V8 PLAN_TABLE<br />

DEGREE(ANY)<br />

TBNAME METHOD MATCHCOL<br />

Evaluate the usage of sort merge join in long running queries. V8 allows improvement if there<br />

are multi-column predicates in sort merge join. If the elapsed time is a concern, the query can<br />

be executed in shorter elapsed time if executed with query parallelism.<br />

3.7 Parallel sort enhancement<br />

PX<br />

P<br />

V8 PLAN_TABLE<br />

(continue)<br />

ACCESSTYE<br />

R<br />

I<br />

0<br />

2<br />

ACCESS<br />

DEGREE<br />

30<br />

?<br />

In V7, parallel sort has the following characteristics:<br />

► Parallel sort enabled <strong>for</strong> single-table sort composite only<br />

► Not cost-based decision<br />

► No threshold to disable parallel sort <strong>for</strong> short running queries<br />

0<br />

1<br />

JOIN<br />

DEGREE<br />

?<br />

3<br />

Elapsed sec CPU sec<br />

Sort composite tables from more than one table can have longer elapsed time because sort is<br />

not executed in parallel. If the composite table is from a single table, then parallel sort is<br />

invoked in V7.<br />

80<br />

70<br />

60<br />

50<br />

40<br />

30<br />

20<br />

10<br />

0<br />

V8 DEGREE(1)<br />

V8 DEGREE(ANY)<br />

Chapter 3. SQL per<strong>for</strong>mance 79

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

Saved successfully!

Ooh no, something went wrong!