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.

2.3% and CPU time at the server with 8.1% again due to the architectural changes in <strong>DB2</strong> V8,<br />

see Figure 7-5.<br />

seconds<br />

6<br />

4<br />

2<br />

0<br />

5.7 5.6<br />

single<br />

row<br />

n=<br />

10<br />

V7 : n= # of single-row Insert SQL calls / message<br />

V8 : n= # of rows per multi-row Insert SQL call / message<br />

Figure 7-5 Multi-row insert - <strong>DB2</strong> client to host<br />

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

Distributed - <strong>DB2</strong> client Host<br />

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

Client<br />

Elapsed Time<br />

2.0<br />

1.4 1.5 1.4 1.4<br />

1.0<br />

0.8 0.8<br />

n=<br />

100<br />

n=<br />

1000<br />

n=<br />

10000<br />

2.0 1.9<br />

single<br />

row<br />

1.1<br />

0.7<br />

V8 V7<br />

If the client application is coded to use array insert the difference with <strong>DB2</strong> V7 becomes<br />

significant. In <strong>DB2</strong> V7 this results still in single row inserts (the array insert only affects the<br />

processing between the application and the CLI/ODBC Driver) but in <strong>DB2</strong> V8 full advantage is<br />

taken from multi-row insert between the DIST and DBM1.<br />

For an application that inserts 10 times an array of 1,000 rows this results in a CPU time<br />

improvement of 51% at the DRDA application server side, and an elapsed time improvement<br />

of 47% <strong>for</strong> the client application, compared to <strong>DB2</strong> V7.<br />

If the ODBC Driver detects <strong>DB2</strong> V8 as the server it translates the insert into a network<br />

transfer of 1 insert of 1,000 rows. If the ODBC Driver detects a pre-V8 server then each<br />

network transfer becomes 1,000 inserts of 1 row each.<br />

Conclusion<br />

Although there is no <strong>DB2</strong> client support <strong>for</strong> native multi-row fetch, the CLI/ODBC<br />

SQLExtendedFetch() function fetches arrays from the query block result sets. At the server<br />

side the DIST address space will start using multi-row fetch by default and fetch a number of<br />

rows that will fit the query block size which results in significant CPU savings.<br />

If your CLI/ODBC applications currently use array insert, you will immediately benefit from this<br />

enhancement as this SQL syntax will now be honored by <strong>DB2</strong> V8 in NFM and not be<br />

translated by the CLI/ODBC Driver into a series of individual row inserts.<br />

n=<br />

10<br />

Server<br />

CPU Time<br />

1.0 1.0<br />

0.5 0.5 0.5<br />

n=<br />

100<br />

n=<br />

1000<br />

1.1<br />

n=<br />

10000<br />

Chapter 7. Networking and e-business 291

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

Saved successfully!

Ooh no, something went wrong!