Tuning a statement from the Query Tuner Workflow Assistant
The other way to execute a script to set up the environment with one or more session tables before tuning a statement is by using the Query Tuner Workflow Assistant. With this method, you must execute the script one line at a time from the Query Text editor.
Note: this method of executing the script in the Query Tuner Workflow Assistant can be used for DB2 for Linux, UNIX, and Windows, and DB2 for z/OS connections for statements using CGTT and DGTT session tables.
- Launch the Query Tuner Workflow Assistant by right clicking the
database name in the Data Source explorer, select Analyze
and Tune, and then click Start
Tuning, as shown in Figure 26.
Figure 26. Example of the launching the query tuner from the Data Source Explorer
- Click Input Text. Enter the first statement of
the script in the Query Text editor area, and then click
Invoke Advisors and Tools, as shown in Figure
Figure 27. Example of the Capture view in the Query Tuner Workflow Assistant
- Enter each line of the script, one at a time, in the Query
Text window. For each line in the script, click the
Run SQL button in the Invoke view. Figure 28
shows an example of executing the Run SQL for
each line of the script.
Figure 28. Example of running SQL from the Query Tuner Workflow Assistant
- You will see the SQL results with the status of the statement, as
shown in Figure 29.
Figure 29. Example of the output of running SQL from the Query Tuner Workflow Assistant
- Figure 30 shows the second line of the same script used in the
previous section, where you must again select the Run
Figure 30. Example of running the second line of SQL from the Query Tuner Workflow Assistant
- After all of the lines of the script to set up the session tables
are run, you can tune the statement that accesses the table as in
the previous section. For example, Figure 31 shows how you would
enter the join query and select the Select What to
Run button, and choose the tuning features to run in
the pop-up menu.
Figure 31. Example of launching query tuning from the Query Tuner Workflow Assistant
At this point, the same tuning features are accessible as was shown in the previous section.