Creating a What-If scenario


Use the following procedure to create a What-If scenario from a source statement and then compare it to Explain results.

Related topics

To create a What-If scenario

  1. In the Performance perspective, select the source statement from a Tuning session. You can use a baseline statement or one of the What-If scenarios that you have previously created.

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

  2. Click NW_create_what_if.png to create a What-If scenario.
  3. (Optional) On the SQL tab, edit the scenario if needed:
    1. Enter a unique name for the What-If scenario.
      If you do not give the scenario a new name, by default BMC AMI Command Center adds an incremental number as a suffix to the source statement name.
    2. Edit the following details of the scenario:
      • Db2 Connection

        Tip

        Click NG_plug_connect_square_blue.png to specify which Db2 connections to include in your list of favorite connections.

      • Table Qualifier
      • Explain Type
      • Degree
    3. Edit the SQL statement as needed:

      Purpose

      Action

      Find a search string

      1. Click Find/Replace NW_lines_search.png.
      2. Enter the search string in the Search box.
      3. Click Find.

      Find and replace a search string

      1. Click Find/Replace NW_lines_search.png.
      2. Enter the search string in the Search box.
      3. Enter the replacement string in the Replace box.
      4. Click Find.
      5. Click Replace.

      Find and replace all instances of a search string

      1. Click Find/Replace NW_lines_search.png.
      2. Enter the search string in the Search box.
      3. Enter the replacement string in the Replace box.
      4. Click Replace All.

      Make a search case sensitive

      Select the Match case check box.

      Enable syntax highlighting

      Select the Use syntax highlighting for SQL statements Command Center option.

      For more information, see Setting Command Center options.

      View SQL statement options

      Click Show more.

      Hide SQL statement options

      Click Show less.

      Undo an action

      Click NW_undo.png to undo the last action.

      Redo an action

      Click NW_share.png to cancel undoing the last action.

  4. (Optional) On the Indexes tab, modify the indexes. For more information, see Creating and editing a What-If index scenario.
  5. When finished, click Generate explain plan NW_generate_explain.png.
  6. (Optional) To export the explain plan to a PDF file, perform the following steps:
    1. Click Generate Report NW_file_text_o.png .
      Based on your browser settings, after Command Center generates the report, either the Save As dialog box is displayed or the browser saves the file automatically.
    2. Enter a name for the file.
    3. Click Save.

Where to go from here

You can now compare this What-If scenario with another scenario or baseline statement.

 

 

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