Creating and editing a What-If index scenario


Use the following procedure to evaluate how adding an index, dropping an index, or updating index statistics would affect a statement's performance.

Before you begin

The What-If index feature is available only if you have a valid license for the BMC Performance for DB2 SQL solution.

QuickCourseArrow.png

For more information, view the Quick Course Workbench for DB2 - Using What-if Index.

To create a What-If index

New BMC Workbench console
  1. In the Performance perspective, select the source statement.You can use a baseline statement or a previously created What-If scenario.

    The SQL tab displays the details of the source SQL statement.

  2. If the selected statement has not been explained, click Generate explain plan NW_generate_explain.png to Explain it.
  3. Click NW_create_what_if.png.
  4. (optional) Enter a unique name for the new scenario.

    Warning

    Note

    If you do not enter a name, the scenario uses the source statement's name with an incremental number added as a suffix.

  5. Click the Indexes tab.

    Warning

    Note

    For more information, see Indexes-tab. The Indexes tab is available only if the baseline statement was successfully explained.

    The Indexes tab includes these items:

    • Command buttons enable you to add, drop, edit, or copy indexes from the What-If statements.
    • The Tables pane lists the tables referenced in the SQL statement.
    • The Indexes pane lists the indexes of the selected table (initially, the top entry in the list).

      Warning

      Note

      g_gud_Check_16.png identifies indexes that the Explain plan uses.

  6. From the Tables pane, select the table that contains the index that you want to edit.
  7.  From the Indexes pane, select the index.Perform any of the following actions to set up the scenario that you want to evaluate:

    Warning

    Note

    You cannot make changes to the baseline statement.

  8. Click Generate explain plan NW_generate_explain.png to explain the edited What-If scenario.

    Warning

    Note

    You cannot edit the What-If scenario after it is explained.

  9. Compare the resulting scenario with the baseline or with another What-If scenario as explained in Comparing-statements.
  10. Continue from Step 7 until you have fully tuned the statement.
  11. If you want to generate the tuned statement, click Generate to copy the DDL.For more information, see Generating-a-tuned-statement.
Classic BMC Workbench console
  1. In the Performance perspective, select the source statement.You can use a baseline statement (identified by BaselineStmt-24.png) or a previously created What-If scenario (identified by WhatIf-24.png).

    The SQL tab displays the details of the source SQL statement.

  2. If the selected statement has not been explained, click explain-24.png to Explain it.
  3. Click What-If WhatIf-24.png.
  4. (optional) Enter a unique name for the new scenario.

    Warning

    Note

    If you do not enter a name, the scenario uses the source statement's name with an incremental number added as a suffix.

  5. Click the Indexes tab.

    Warning

    Note

    For more information, see Indexes-tab. The Indexes tab is available only if the baseline statement was successfully explained.

    The Indexes tab includes these items:

    • Command buttons enable you to add, drop, edit, or copy indexes from the What-If statements.
    • The Tables pane lists the tables referenced in the SQL statement.
    • The Indexes pane lists the indexes of the selected table (initially, the top entry in the list).

      Warning

      Note

      g_gud_Check_16.png identifies indexes that the Explain plan uses.

  6. From the Tables pane, select the table that contains the index that you want to edit.
  7.  From the Indexes pane, select the index.Perform any of the following actions to set up the scenario that you want to evaluate:

    Warning

    Note

    You cannot make changes to the baseline statement.

  8. Click explain-24.png to explain the edited What-If scenario.

    Warning

    Note

    You cannot edit the What-If scenario after it is explained.

  9. Compare the resulting scenario with the baseline or with another What-If scenario as explained in Comparing-statements.
  10. Continue from Step 7 until you have fully tuned the statement.
  11. If you want to generate the tuned statement, click Generate to copy the DDL.For more information, see Generating-a-tuned-statement.


This section contains the following topics :

Related topic



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Workbench for DB2 12.1