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.

► Complexity of the fetch. The fixed overhead saved <strong>for</strong> not having to go between the<br />

database engine and the application program has a lower percentage impact <strong>for</strong> complex<br />

SQL that has longer path lengths.<br />

If the multi-row fetch reads more rows per statement, it results in CPU time improvement, but<br />

after 10 to 100 rows per multi-row fetch, the benefit is decreased. The benefit decreases<br />

because, if the cost of one API overhead per row is 100% in a single row statement, it gets<br />

divided by the number of rows processed in one SQL statement. So it becomes 10% with 10<br />

rows, 1% with 100 rows, 0.1% <strong>for</strong> 1000 rows, and then the benefit becomes negligible.<br />

It turns out that the percentage improvement is larger when class 2 accounting is turned on,<br />

because the cost of class 2 accounting which was encountered <strong>for</strong> each row fetched now is<br />

encountered only <strong>for</strong> each multi-row fetch SQL statement. So the cost of class 2 accounting<br />

would be dramatically reduced, <strong>for</strong> example, 100 times if fetching 100 rows in one multi-row<br />

fetch SQL statement.<br />

Multi-row insert per<strong>for</strong>mance<br />

Figure 3-5 shows the CPU time (class 1) measurements <strong>for</strong> single-row insert and multi-row<br />

insert of 100,000 rows into a non-partitioned table space.<br />

Class 1 CPU Time (Sec)<br />

4<br />

3<br />

2<br />

1<br />

0<br />

Figure 3-5 CPU time (class 1) <strong>for</strong> single-row and multi-row insert<br />

The measurements, compared to V7, show:<br />

► For single-row fetch there is a reduction in CPU time when we compare the<br />

measurements in V7 and V8 and insert requests.<br />

► 35% CPU time improvement with MR=10 rows<br />

► 40% CPU time improvement with MR=100+ rows<br />

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

2.92<br />

Multi-row Insert Per<strong>for</strong>mance<br />

(100,000 rows Inserted / test)<br />

Single-row V8 multi-row<br />

2.73<br />

2.51<br />

V7 V8 50kx2 10kx10 1kx100 100x1k 10x10k<br />

1.94<br />

1.8<br />

1.79<br />

V8 with explicit multi-row Insert<br />

50kx2 - 50,000 insert loops, 2 rows per multi-row insert<br />

10kx10 - 10,000 insert loops, 10 rows per multi-row insert<br />

1kx100 - 1,000 insert loops, 100 rows per multi-row insert<br />

100x1k - 100 insert loops, 1,000 rows per multi-row insert<br />

10x10k - 10 insert loops, 10,000 rows per multi-row insert<br />

1.79

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

Saved successfully!

Ooh no, something went wrong!