76 DB2 9 for z/OS: New Tools for Query Optimization
Figure 2-46 Statistics Advisor second recommendation
Chapter 2. Sample query optimization 77
3. Select the first recommendation again. This shows the Runstats to be run immediately. If
we click Run at the right, Optimization Service Center runs the Runstats. On completion,
you are asked if you wish to rerun the Statistics Advisor (Figure 2-47).
Figure 2-47 Completion of Runstats
4. Rerun the Statistics Advisor. The result is shown in Figure 2-48 on page 78. You now have
no high priority recommendation.
78 DB2 9 for z/OS: New Tools for Query Optimization
Figure 2-48 Result of rerunning the Statistics Advisor
You can recreate the Access Plan Graph to see if the new statistics have changed the access
path.
The Statistics Advisor can also make recommendations based on a set of SQL statements
rather than a single SQL statement. You can extract the set of SQL statements from a file, the
DB2 catalog, the global dynamic statement cache, or a number of other sources. This is
discussed in Chapter 9, “Statistics Advisor” on page 223.

Get IBM DB2 9 for z/OS: New Tools for Query Optimization now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.