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.

Table UDF – Cardinality Option<br />

SELECT .....<br />

FROM ORDER A , TABLE(TUDF(100000 )<br />

CARDINALITY 100000) AS B<br />

WHERE A.cust_key = B.int_key<br />

AND A.order_key BETWEEN 1 AND 1500000 ;<br />

Access path is<br />

changed from<br />

NLJ to HBJ<br />

with correct<br />

cardinality<br />

value 100000<br />

Figure 3-37 Table UDF - Cardinality option<br />

Figure 3-38 shows the measurements with no block fetch and with block fetch.<br />

Table UDF – Block Fetch Support<br />

seconds<br />

seconds<br />

Figure 3-38 Table UDF - Block fetch support<br />

300<br />

250<br />

200<br />

150<br />

100<br />

150<br />

100<br />

50<br />

0<br />

50<br />

0<br />

10 100000<br />

cardinality<br />

Non block fetch Block fetch<br />

Elapsed<br />

CPU<br />

Elapsed<br />

CPU<br />

Block Fetch support<br />

Materialize the rows from a table UDF into a workfile at UDF open call<br />

CPU improvement by avoiding task switches.<br />

Native Measurement using a simple Table UDF<br />

Measured in 10 to 1M rows<br />

About 40% CPU time was saved using Block Fetch support or a simple Table UDF<br />

on Freeway Turbo<br />

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

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

Saved successfully!

Ooh no, something went wrong!