Tuning SQL statements
Use the Tuning Actions window from an editor.
From the pop-up menu action to open the Tuning Actions window, you can choose these actions:- Visual Explain: Generates a graphical representation of a query path.
- Statistics Advisor: Generates RUNSTATS for a query.
- Capture Query Environment: Captures the runtime environment for a query.
Before you start
IBM® Developer for z/OS® uses the Db2® for z/OS SQL Tuning Services server to run the tuning actions. Before you can use these actions, you must create a connection to the SQL Tuning Services server and configure tuning options.
- Gather the following information from a Db2 for z/OS administrator:
- The port to use to connect to the server.
- The name of a database connection profile that has EXPLAIN tables configured. During the following procedure, you can also create a database connection profile and generate EXPLAIN tables for it.
- To create a connection to the server:
- In the Remote Systems view, expand a z/OS system connection, and then expand the Db2 for z/OS subsystem.
- Right-click SQL Tuning Services Servers and select .
- Log in to the remote system using your Db2 user ID and password.
- Type the HTTP port range, and then click Test Connection. Developer for z/OS connects to the tuning server.
- To configure tuning services:
- In the Db2 for z/OS subsystem, expand Db2 for z/OS Connections, right-click a database connection, and select Properties.
- From the list of properties pages, click Tuning.
- From the Database connection profile list, choose a profile. You can also click New to create a profile.
- Click Apply and Close.
To learn more about the SQL Tuning Services server, EXPLAIN tables, and database connection
profiles, see these topics:
- Getting started with SQL Tuning Services (links to the IBM Documentation for Db2 for z/OS)
- Investigating SQL performance by using EXPLAIN (links to the IBM Documentation for Db2 for z/OS)
- Creating a database profile and EXPLAIN tables
Tuning SQL
After you connect to a Db2 SQL Tuning Services server, you can select and tune SQL statements from the COBOL, PL/I, SQL, or z Systems® LPEX Editor.
- Open the editor on a file that contains SQL statements.
- Select an SQL statement, and then right-click and select
(Ctrl+Alt+T or
⌥+⌘+T).Tip: To set options for the Tune SQL commands select the Tune SQL Options menu item. The context-sensitive helps contain descriptions of the options on the Tune SQL Options page.
- On the Tuning Actions window,
select one or more tuning actions, and then click OK.
The tuning data is displayed in the Remote System Details view.
- To see the output of each tuning action, select it and click Open Results.
For more information about the tuning actions, see these topics: