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.

► The elapsed time is 22 times smaller (about 95%) and CPU time 68 times smaller (about<br />

98%) when we compare V7 DEGREE(1) with V8 using the MQT.<br />

Figure 3-11 Query rewrite <strong>for</strong> simple query<br />

Query rewrite <strong>for</strong> join<br />

Figure 3-12 reports the per<strong>for</strong>mance of a query rewrite <strong>for</strong> a join.<br />

The query rewrite <strong>for</strong> join is similar to the simple query. The plan table <strong>for</strong> V7 shows the join of<br />

the three tables (633k, 1.5 M and 1.3 M rows) using nested loop join. The execution in <strong>DB2</strong><br />

V8 uses the MQT201 that reads 171 rows with a large reduction in the elapsed and CPU<br />

time. Summary of the measurements of query rewrite <strong>for</strong> join:<br />

► V7 DEGREE(1)<br />

28.02 sec. elapsed, 16.52 sec. CPU<br />

► V7 DEGREE(ANY)<br />

14.25 sec. elapsed, 17.9 sec. CPU<br />

► V8 using MQT<br />

0.9 sec. elapsed, 0.07 sec. CPU<br />

In this example, there is a reduction of 31 times (about 96%) in elapsed time and 236 times<br />

(about 99%) in CPU time when we compare V7 DEGREE(1) with V8 using the MQT.<br />

48 <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 />

Query rewrite <strong>for</strong> a simple query<br />

V7 PLAN_TABLE<br />

TNAME TABLE_TYPE ACCESSTYPE<br />

EVE T R<br />

V8 PLAN_TABLE<br />

TNAME TABLE_TYPE ACCESSTYPE<br />

MQT091 M R<br />

30<br />

25<br />

20<br />

15<br />

10<br />

5<br />

0<br />

V7 DEGREE(1)<br />

V7 DEGREE(ANY)<br />

V8 using MQT<br />

22X<br />

70X<br />

Elapsed sec CPU sec

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

Saved successfully!

Ooh no, something went wrong!