The
primary purpose
of a Query Tuner project
is to save and allow you to review the recommendations, analyses,
and reports that you generate in the workflow assistant. You can start
tuning without first creating a Query Tuner project.
However, if you want to save your work and return to it later, you
must save it in a Query Tuner project.
Objects for tuning single SQL statements include query groups,
query nodes, analysis results, and reports.
- Query group
- A query group is a folder
that contains one or more query nodes.
The
following image shows a single query group within a Query Tuner project.
- Query node
- Each
query node in a Query Tuner project
contains the text of an SQL statement. You create query nodes in one
of these ways:
- When you close a workflow assistant in which
you captured an SQL
statement, you can choose to save the SQL statement in a new query
node.
- When you close a workflow assistant after running tools
and advisors
on an SQL statement that you just captured, you can choose to save
the SQL statement and the analysis result in a new query node.
- When
you right-click a query group in a Query Tuner project
and select Tune Query.
When you
double-click a query node in a Query Tuner project,
the workflow assistant for query tuning opens to the Invoke section
and the SQL statement appears in the Query Text field.
You can run the advisors and tools, or you click the Review tab
to open the Review section
and view the current or saved analysis results.
The following
image shows a single query node within a Query Tuner project.
When
there is more than one query node in a project, you can switch between
their SQL statements in the Invoke section
of the workflow assistant. To switch, in the top-left corner of the Invoke section
select the query node that contains the SQL statement. This corner
of the Invoke section
lists the query groups that are in the current project and the query
nodes within those query groups.
- Analysis result
- Each analysis result
includes the output of all of the tools and
advisors that you run on an SQL statement at one time. For example,
if you generate an access plan graph and run the Statistics Advisor
at the same time, the analysis result contains the access plan graph
and recommendations from the Statistics Advisor. Every time that you
run one or more advisors or tools on a statement, an analysis result
is added to the corresponding query node.
The following image shows
a single analysis result within a Query Tuner project.
When you double-click an analysis result in a Query Tuner project,
the workflow assistant for query tuning opens, so that you can review
the content of that analysis result. You can also review all of the
analysis results for an SQL statement for that statement over time.
In the Review section,
you can switch between analysis results by selecting them in the top-left
corner. For example, in the next image, the Review section
shows two analysis results for the current query node Query 1.
You can rename an analysis result by right-clicking
it in the Project Explorer or in the workflow assistant and selecting Rename.
The new name appears in both the Project Explorer and the workflow
assistant.
- Reports
- When you
generate a report, the workflow assistant saves that
report within an analysis result.
The following image shows four
reports that are related to an SQL statement that runs on DB2® for z/OS®.
The
reports that you generate are also listed in the Review section
of the workflow assistant.
You can rename a report by right-clicking
it in the Project Explorer or in the workflow assistant and selecting Rename.
The new name appears in both the Project Explorer and the workflow
assistant.