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.

3.5.2 Conclusions<br />

Figure 3-31 Access path improvements - Multi-column statistics<br />

Measurements of CPU time <strong>for</strong> top consuming queries:<br />

► Query Q7011<br />

CPU time = 132 sec. in V7 to 27 sec. in V8 (68% reduction, factor of 3.2)<br />

► Query Q2042<br />

CPU time = 76 sec. in V7 to 27 sec. in V8 (64% reduction, factor of 2.8)<br />

► Query Q800<br />

CPU time = 68 sec. in V7 to 66 sec. in V8 (2% reduction)<br />

The improvement ratio varies and tends to be more significant in complex queries involving<br />

more tables and more predicates.<br />

Multi-column statistics provided by the RUNSTATS utility in V8 allow <strong>DB2</strong> to better estimate<br />

the filtering factor <strong>for</strong> a query.<br />

This benefits queries with multiple predicates in one table and joins of multiple tables. As the<br />

number of predicates increases and the number of tables joined increases, there is more<br />

opportunity <strong>for</strong> improvements.<br />

3.5.3 Recommendations<br />

Access path improvements - multi-column statistics<br />

CPU Time (sec)<br />

150<br />

100<br />

Q2042<br />

Q200<br />

In case you are not satisfied with query per<strong>for</strong>mance, we recommend collecting the<br />

distribution statistics on the non-leading indexed columns and/or non-indexed columns, which<br />

are used as predicates in the query (<strong>for</strong> which there are no statistics in the catalog).<br />

Collecting these statistics can ensure <strong>DB2</strong> can use them <strong>for</strong> better access path selection.<br />

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

50<br />

0<br />

Q800 Q10002 Q1005<br />

Q7011 Q16203<br />

Query Number<br />

Q19<br />

V7<br />

V8

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

Saved successfully!

Ooh no, something went wrong!