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.

in ms = 1 and the CPU cost is 16 service units. We save 1 millisecond, or 16 SUs on<br />

accessing a very small catalog.<br />

Figure 3-48 Consistency query - 31 New<br />

3.15.3 Statistics Advisor<br />

Statistics Advisor is a new function from the Web, available with Visual Explain. Its main<br />

purpose is to help you identify the RUNSTATS executions that help your SQL. Sometimes it is<br />

not simple at all to understand which statistics can help your queries. The Statistics Advisor<br />

builds the RUNSTATS statements <strong>for</strong> the correct set of statistics, gives you consistent and<br />

accurate in<strong>for</strong>mation, and you just need to run the RUNSTATS and per<strong>for</strong>m some tests, and<br />

the problem is solved. You can continue to run the Statistics Advisor until it no longer provides<br />

suggestions.<br />

The Statistics Advisor (SA) analyzes the predicates, column (groups) used as predicates,<br />

type of predicates, per<strong>for</strong>ms statistical analysis, checks missing statistics (default), conflicting<br />

statistics, missing appropriate correlations, and skew statistics. Based on all of that, the<br />

Statistics Advisor gives you suggestions on the RUNSTATS to execute. Furthermore, it gives<br />

you an explanation and a conflict report.<br />

We use the following simple SQL statement against the EMP table of the <strong>DB2</strong> V8 sample<br />

database:<br />

SELECT * FROM DSN8810.EMP WHERE HIREDATE < '2004-12-31' AND SALARY < 25000 AND SEX = 'M';<br />

We start SA from the main panel, shown in Figure 3-49, where we enter the statement to be<br />

analyzed, explained, or run.<br />

116 <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>

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

Saved successfully!

Ooh no, something went wrong!