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.

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

3<br />

In this chapter we discuss the major per<strong>for</strong>mance enhancements that affect SQL. The chapter<br />

contains the following sections:<br />

► Multi-row FETCH, INSERT, cursor UPDATE and DELETE<br />

Multi-row operations can be executed in a single SQL statement explicitly to process a<br />

rowset. It is used implicitly by default in the distributed environment as described in<br />

Chapter 7, “Networking and e-business” on page 281. The DSNTEP4 sample is similar to<br />

DSNTEP2 and exploits multi-row fetch as described in Chapter 9, “Installation and<br />

migration” on page 341.<br />

► Materialized query table<br />

Materialized query tables (MQT) can be created in NFM as a pre-computed join, sort or<br />

aggregation and re-used by <strong>DB2</strong> query rewrite in dynamic SQL to improve the execution<br />

of long running queries in the Data Warehouse type environment.<br />

► Star join processing enhancements<br />

The execution of star join is improved by: Access path enhancements, better estimates of<br />

the filtering effect of dimensions, the use of sparse index in cache, and the use of<br />

in-memory work file.<br />

► Stage 1 and indexable predicates<br />

The predicates comparing mismatched string data types or comparing mismatched<br />

numeric data types that are Stage 2 in <strong>DB2</strong> V7 can become Stage 1 and indexable in <strong>DB2</strong><br />

<strong>Version</strong> 8. This benefit can be obtained by rebinding the plan or package.<br />

► Multi-predicate access path enhancement<br />

Queries which contain two or more predicates referencing a table may get a better access<br />

path with statistics <strong>for</strong> a group of columns (non-indexed) collected by RUNSTATS.<br />

► Multi-column sort merge join<br />

Access path selection allows multi-column predicates <strong>for</strong> sort merge join (SMJ) with<br />

mismatched string data types; decides to sort new table based on cost and enables query<br />

parallelism <strong>for</strong> multi-column sort merge join (MCSMJ).<br />

© Copyright <strong>IBM</strong> Corp. 2005. All rights reserved. 29

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

Saved successfully!

Ooh no, something went wrong!