SQL Tab
The SQL tab in the SQL Optimizer window consists of three panes: SQL Text, SQL Information and Run Time.
On this tab, perform any of the following:
-
Enter or edit the original SQL statement. (See Enter or Edit the Original SQL Statement.)
- View the SQL alternatives that the Optimizer generates. (See Automatically Rewrite the Original SQL Statement.)
- View the index-set alternatives that the Index Expert function generates. (See Generate Index-Set Alternatives.)
- Create your own the SQL alternatives. (See Add User-Defined SQL Alternatives.)
- View the index-set alternatives that you create. (See Add Your Own Virtual Index Sets.)
-
Review the access plan for the original SQL and for each SQL or index-set alternative.
-
Review the run-time statistics after all alternatives are batch-executed.
SQL Text Pane
Use the SQL Text pane to view the original SQL statement syntax or the SQL associated with a specific SQL alternative. For an index-set alternative, view the index DDL. You can also use this pane to enter or edit the text of the original SQL statement or to enter the text of an SQL alternative you are manually creating.
SQL Information Pane
Use the SQL Information pane to toggle between the access plan or the DB2 optimized text for the original SQL or an alternative. You can also view information about the original SQL.
Run Time Pane
The Run Time pane displays the SQL or index-set alternatives automatically generated or created manually on the original SQL. Use the SQL Navigation buttons to move between alternatives. When you perform a Batch Run, this list shows the run time statistics for retrieving all records and for retrieving the first n records for the original SQL and each alternative.
Display or Hide Panes
Use the pane-control buttons to reorganize the panes:
To display the SQL Text, SQL Information, and Run Time panes
Click .
To display only the SQL Text pane
Click .
To display the SQL Text and SQL Information panes
Click .
To display the SQL Text and Run Time panes
Click .