Use the Compare section
of the workflow
assistant for query tuning to compare two access plan graphs.
Before you begin
- Generate
the two access plan graphs that you want to compare.
- (Optional)
Set your preferences for the types of differences to
show and the colors to use for highlighting the differences. Select . In the Preferences window, expand and select Access
Plan Graph Compare.
About this task
By comparing
access plan graphs, you can find out whether
changes that you made to an SQL statement have improved the access
plan for that statement. The Compare section lists and highlights
the differences.
Procedure
To compare two access
plan graphs:
- In the workflow assistant for
query tuning open, click
the Compare tab.
On the Compare
Access Plan Graphs page, the analysis results in the current
instance of the workflow assistant are listed together with the analysis
results that are in any saved projects in your workspace.
For
example, suppose that in your workspace there is a project named Project1.
In that project, you saved analysis results for two different SQL
statements. In the current instance of the workflow assistant, you
run advisors and tools on an SQL statement twice. Then, you go to
the Compare section. On the Compare
Access Plan Graphs page, you see these two lists.
Table 1. The two lists that appear for this example situationLeft side |
Right side |
 |
 |
- On the left side of the Compare Access
Plan Graphs page,
select an analysis result for the comparison.
- On
the right side, select the other analysis result for
the comparison.
- Click the Compare button
at the
top of the page. A new page opens that lists the
differences. The page also shows the access plan graphs side by side,
with the differences highlighted in each graph.
Example
Suppose that you wanted to generate an access plan
graph
for an SQL statement that you captured, tune that statement, and then
generate an access plan graph for the tuned statement, so that you
could compare the access plans.
- In the workflow assistant,
generate an access plan graph for an
SQL statement. You can generate an access plan graph from the Run
All Single-Query Advisors and Analysis Tools page of the Invoke section
of the workflow assistant. Click the Run Default Advisors
and Tools button to generate the access plan graph, as
well as recommendations from the advisors and a formatted version
of the SQL statement. The workflow assistant saves the results internally
as Current Project_data_server/Query Group 1/Query
1/Analysis Result 1.
- Tune the SQL statement, according to
the recommendations and your
analysis of the formatted query and access plan graph.
- Generate
another access plan graph for the statement. Again, click
the Run Default Advisors and Tools button on
the Run All Single-Query Advisors and Analysis Tools page
of the Invoke section. The workflow assistant
saves the results internally as Current Project_data_server/Query
Group 1/Query 1/Analysis Result 2.
- Click the Compare tab.
- For the left side of the comparison, select Current Project_data_server/Query
Group 1/Query 1/Analysis Result 1.
- For the right side of the
comparison, select Current Project_data_server/Query
Group 1/Query 1/Analysis Result 2.
- Click the Compare button
at the top of
the page.