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.

.<br />

SELECT * FROM PAOLO.TORDER<br />

WHERE ORDERNO BETWEEN 15000 AND 17000<br />

STAGE 2<br />

PREDICATES<br />

1<br />

INDEXED<br />

predicate<br />

root<br />

page<br />

DBAS<br />

Buffer<br />

Figure 3-24 Analysis of Stage 1 and Stage 2 predicates<br />

Stage 1 predicates are simple predicates evaluated by <strong>DB2</strong>. They are evaluated first to<br />

reduce processing cost and eliminate the number of rows to be evaluated by the complex<br />

predicates. Stage 2 predicates are complex predicates evaluated by <strong>DB2</strong>’s more complex<br />

analysis. They are also known as residual predicates.<br />

An indexable predicate is a predicate that can use a (matching) index access as an access<br />

path. Indexable predicates are always stage 1, but not all stage 1 predicates are indexable.<br />

Stage 1 predicates are better than stage 2 predicates.<br />

However, if your application has been coded in C on a work station, that language does not<br />

have a DECIMAL data type, although some of the existing tables might have columns defined<br />

as DECIMAL(p,s).<br />

Java does not have a fixed length character string data type; every string is variable length.<br />

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

STAGE 1<br />

PREDICATES<br />

2<br />

OTHER index key<br />

predicates applied<br />

some<br />

leaf<br />

pages<br />

TORDER<br />

.<br />

Applies ALL<br />

Stage 2<br />

Predicates<br />

4<br />

3<br />

Applies ALL<br />

other Stage 1<br />

predicates<br />

some<br />

data<br />

pages<br />

I/O<br />

ROWS<br />

PAGES<br />

GETPAGE results in<br />

I/O operation<br />

if the page is not in<br />

the BUFFERPOOL.<br />

GETPAGES<br />

Scans DATA<br />

PAGES from<br />

TORDER doing<br />

matching index<br />

scan from<br />

15000 to 17000

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

Saved successfully!

Ooh no, something went wrong!