SQL plan analysis
The SQL Plan Analysis function of File-AID for Db2 enables you to examine the performance efficiency of your SQL statements.
Select option 1 from the SQL Analysis and Development menu (SQL Analysis and Development Menu). The SQL Plan Analysis Specification Screen displays. On this screen you can explain a plan, DBRM, collection ID, or package and obtain rules-based analysis in plain language. An SQL predicate analysis is also available.
SQL Analysis uses a 2 phase processing approach for SQL Analysis:
- Summary data from the Explain Tables is obtained from Db2 and is used to build the SQL Analysis Summary panel (SQL Analysis Summary).
- Detail data from the Explain Tables is obtained from Db2 when you select an SQL statement for further detail.
The current SQLID value is obtained prior to the summary data query being issued (phase 1). This SQLID is used for all queries until one or both of the following occurs:
- You change the current SQLID to a new value and issue an SQL command in Access Path Analysis or Predicate Analysis and change the SQL statement text. This results in a new Db2 EXPLAIN being performed. In this situation, the new SQLID value is used for the newly explained SQL statement.
- You change the current SQLID to a new value before issuing a new explain of a Db2 Plan, Collection ID or Package. The new SQLID value is used for all subsequent explains.
The flow chart in the following figure shows you how to navigate through the screens when processing the analysis in online mode. See Explaining-Objects-in-Batch for information on batch processing.
SQL Plan Analysis Flow Chart — Online Processing Mode
This section provides information about the following topics: