Chat now with support
Chat with Support

SQL Optimizer for DB2 ZOS 5.6.1 - User Guide

Welcome Optimize SQL Options Tutorial About us Third-party contributions Copyright

Compare SQL Statements

Use the Compare window to view the SQL text, execution plan, and execution statistics for your original SQL statement and all alternatives SQL Optimizer generated. The Compare window consists of the Alternatives window and the Comparison window. The Alternatives window displays execution statistics and the Comparison window displays SQL statements and execution plans. You can compare your original SQL statement with an alternative SQL Optimizer generated or compare two different alternatives.

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To compare SQL statements

  1. Select the SQL Details tab in the main window.
  2. Click .

  3. Select an alternative in the Alternatives window to compare the statement with your original SQL statement.

    Note: The Comparison window displays the SQL text and execution plan for the original SQL statement in both panes by default.

    Tip: The alternative you selected is shown under your original SQL statement in the Alternatives window by default. To unfreeze the alternative selected, right-click the alternative and select Unfreeze Comparing Rows.

  4. Click to switch the location of the original SQL statement and selected alternative in the Comparison window.

    Note: Change the location of the original SQL statement to compare two alternative statements. Once you select the first alternative, click and select the second alternative.

  5. Click the current layout option in the Comparison Window to change the layout for the statements you are comparing. Review the following for additional information:

    SQL and Plan (Left-Right) Displays the SQL text and execution plan for the statements you are comparing side by side.
    SQL Only (Left-Right) Displays the SQL text for the statements you are comparing side by side.
    Plan Only (Left-Right) Displays the execution plan for the statements you are comparing side by side.
    SQL and Plan (Top-Bottom) Displays the SQL text and execution plan for the statements you are comparing beneath each other.
    SQL Only (Top-Bottom) Displays the SQL text for the statements you are comparing beneath each other.
    Plan Only (Top-Bottom) Displays the execution plan for the statements you are comparing beneath each other.

    Tips:

    • Click to maximize the comparison window.

    • Click to restore the comparison window to its original size.

  

Related Topics 

Generate Optimize SQL Resolution Report

You can generate a resolution report in SQL Optimizer after you optimize your SQL statement and test run the alternatives. The resolution report includes the following:

  • Resolution summary

  • Original SQL statement

  • Optimization Session Information

  • Scenario List

  • Comparison Graph

  • Best Alternative Scenario

Note: This topic focuses on information that may be unfamiliar to you. It does not include all step and field descriptions.

To generate an Optimize SQL resolution report

  1. Select the SQL Details tab in the main window.
  2. Click .

  3. Click in the Report window to customize the information displayed in the resolution report.

    Tip: You can display execution plans in text mode, grayscale graphic mode, or full color graphic mode.

  

Related Topics  

Optimize SQL Statements

Test Run SQL Alternatives

Troubleshoot Optimization Results

After you optimize the original SQL statement and determine the best alternatives, you may find the performance of the selected statements unsatisfactory in your database environment.

Make adjustments to the intelligence, optimization, SQL options, or quota setting options if SQL Optimizer has reached any of the quotas. To access these settings, click and select Optimize SQL | SQL Rewrite.

Additionally, review the execution plan of the original and optimized SQL statements to check if you need to change the database structure.

 

Related Topics

Optimize SQL Statements

Automatically Optimize SQL Statements

Test Run SQL Alternatives

Options

Related Documents