Chatta subito con l'assistenza
Chat con il supporto

SQL Optimizer for DB2 LUW 5.0 - User Guide

SQL Optimizer for IBM® DB2® LUW
UsageStatistics Getting Started Options SQL Scanner SQL Optimizer SQL Formatter SQL Inspector Database Explorer SQL Repository Index Impact Analyzer Index Usage Analyzer User-Defined Temp Table Editor Functions SQL Functions SQL Information and Functions Activity Log
Tutorials About us Copyright

SQL Functions

Quest SQL Optimizer for IBM® DB2® LUW maximizes SQL performance by automating the manual, time-intensive and uncertain process of ensuring that SQL statements are performing as fast as possible. SQL Optimizer analyzes, rewrites, and evaluates SQL statements within multiple database objects, files. With SQL Optimizer, you can analyze and optimize all your problem SQL from multiple sources. SQL Optimizer also provides you a complete index optimization and plan change analysis solution, from index recommendations to simulated index impact analysis, through comparison of multiple SQL access plans.

SQL Optimizer provides you with the following main modules.

SQL Optimizer (including SQL Rewrite and Generate Indexes functions)

SQL Formatter

Database Explorer

SQL Scanner

SQL Inspector

SQL Repository

Index Impact Analyzer

Index Usage Analyzer

 

About SQL Functions

SQL Functions are available in evaluating index-set and SQL alternatives. These functions are:

Show Plan

Run Result (SQL alternatives only)

Run for First Record

Run for All Records

Test for Scalability

Convert Parameter Markers

 

Retrieve Access Plan

The access plan is a combination of steps the optimizer chooses in order to execute a SQL statement. It is the ordered set of steps required to carry out the query with the operators chosen for each table.

To view only the access plan of the original SQL statement

From the SQL Information pane, click image\B_ShowPlan.gif.

Note: The Rewrite SQL, Generate Indexes, Run for All Records, Run for First Record, and Run Result functions also retrieve the corresponding access plan.

 

Retrieve Run Result

Note: This feature is available for only SQL alternatives, not index-set alternatives.

To retrieve the SQL statement results from the database

In the SQL Optimizer window, select the SQL alternative, and click image\B_RunResult.gif.

If the SQL statement contains a result set, the SQL Result window displays, showing all data retrieved. Otherwise, an information dialog box showing the number of rows affected displays.

In the SQL Result window, the first rows of the result set are displayed as soon as they are returned from the database. Therefore, the time it takes for you to see the result does not equal the time measured by the run- time functions to retrieve either the first record or all records run time. Run Result only retrieves enough records to display in the window; the complete result set is not retrieved until you view the last records.

To terminate the Run Result process

Click image\B_AbortRunResut.gif.

Commit or Rollback

Two types of action, commit or rollback, can be made after the Run Result has been executed for a UPDATE, INSERT, or DELETE SQL statement depending on which window you are in when you execute the Run Result function.

For the original SQL statement

When you retrieve run results for the original SQL statement (displayed as <Edit SQL>), you are prompted to commit or rollback for UPDATE, INSERT, and DELETE SQL statements.

For the SQL alternatives

For the SQL alternatives, all rows affected by UPDATE, INSERT, and DELETE SQL statements are rolled back automatically.

New Database Session

When you log on to DB2 LUW from SQL Optimizer, it connects to the database and maintains this database connection throughout the application execution. Another database session is required for the Run Result processing. This connection is established when the Run Result function is executed and dropped after all the records have been retrieved.

 

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione