Chapter 3. Overview of tools to analyze database performance 37
After you run your query, in the Run SQL Scripts window, select View → Joblog to view the
debug messages in the job log. In our example, we used the SQL statement shown in
Example 3-1.
Example 3-1 Example SQL statement
SELECT year, month, returnflag, partkey, quantity, revenue_wo_tax
FROM veteam06.item_fact
WHERE year = 2002 and month = 6 and returnflag = 'R';
The detailed job log describes information that you can use to identify and analyze potential
problem areas in your query such as:
Indexes
File join order
Temporary result
Access plans
Open data paths (ODPs)
All of this information is written to the job log when under debug using the STRDBG
command.
Figure 3-8 shows an example of the debug messages contained in the job log after you run
the previous query.
Figure 3-8 Job log debug messages
After you enable these settings for a particular job, only debug messages relating to queries
running in that job are written to the job log. You see the same debug messages with this
option as those explained later when the QAQQINI parameter MESSAGES_DEBUG is set to
*YES. You also see additional SQL messages, such as “SQL7913 - ODP deleted and SQL7959
- Cursor CRSRxxxx closed”, in the job log.
Select any of the debug messages displayed in the job log. Click File → Details to obtain
more detailed information about the debug message. Figure 3-9 shows an example of a
detailed debug message that is displayed.
By looking at the messages in the job log and reviewing the second-level text behind the
messages, you can identify changes that might improve the performance of the query such
as:
Why index was or was not used
Why a temporary result was required
Join order of the file
Index advised by the optimizer