Chat now with support
Chat with Support

SQL Optimizer for DB2 LUW 4.3.1 - User Guide

SQL Optimizer for IBM® DB2® LUW
About SQL Optimizer for IBM DB2 LUW 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

Index Generation Details

The Index Generation Details dialog is optional and can be displayed after index generation. This dialog displays the following:

  • Number of virtual indexes investigated

  • Number of virtual index-sets initially created

  • Number of virtual index sets that produced unique access plans

  • Number of virtual index sets eliminated due to identical access plan

  • A warning message if the Index Generation Quota or Index Set Generation Quota is reached.

    Note: Consider increasing the quota values on the Quota page for SQL Rewrite in Options to increase the likelihood of finding index sets that can give you better performance for the original SQL statement.

Unless disabled, the Index Generation Details dialog displays each time an index-generation process completes. To disable this window, clear the Show details on next index generation option in the Index Generation Details dialog.

If no index-set alternatives are available, the Optimize button is enabled to let you start an automatic rewriting of the original SQL statement for optimization.

To open the Index Generation Details dialog anytime

Select View | Show Index Generation Details.

 

Add Your Own Virtual Index Sets

Use the Simulate Indexes function to create your own virtual index sets.

This function is part of Index Expert, an internal component that facilitates the management and testing of generated and user-defined virtual indexes in your SQL Optimizer session.

Creating Your Own Virtual Indexes or Index Sets

  1. Click to open a SQL Optimizer session.

  2. Enter the original SQL statement for which you feel performance improvement can be achieved with the addition of new indexes.

    Tip: To move an SQL statement from anther tool—such as Scanned SQL Viewer, SQL Formatter, Database Explorer, or SQL Comparer—into SQL Optimizer, select the statement within the tool, and click image\B_CopyToIndexExpert.gif. This features automatically run the Generate Indexes function described in the next step.

  3. Click to generate virtual index-set alternatives that Index Expert recommends. Use these alternatives as a basis for determining which additional virtual indexes you want to define.
  4. Click image\B_IndexSimulator.gif to open the Simulate Indexes window.

    Note: If you have generated index sets (see step 3), these index sets are already listed in the Simulate Indexes window.

  5. If no user-defined index exists, the Add Index window appears automatically. Otherwise, click image\B_AddIndex.gif on the right side of the Create Index here box.

  6. Enter the index properties.

  7. Select one of the three options:

    • Create a new Index Set for this indexto create the index and the index set to which the index belongs

    • Add to existing index set to create the index and add it to an existing user-defined index set

    • Not assign to any index set to add the index without adding it to any index set

  8. Click OK to create the index and add it to the specified index set (in the top right pane).

  9. Continue to create indexes and add them to index sets as needed.

Deleting User-Defined Indexes

  1. Select the index you want to delete from the list in the top left pane (Create Index here).

  2. Click image\B_RemoveIndex.gif.

    Note: You can delete only those indexes not belonging to an index set.

Adding Index Sets

  1. Click image\B_AddIndex.gif in the top right pane (Create Index Set here).

  2. Enter a name for the index set.

  3. Select the indexes you wish to add to the set.
  4. Click OK.

Deleting user-defined index set

  1. Select the index set from the list in the top right pane (Create Index Set here).

  2. Click image\B_RemoveIndex.gif.

Adding and Removing Index from Index Set

In the bottom pane of the Simulate Indexes window, add or remove indexes from the index set by double-clicking the appropriate cell.

Adding Index Sets as Alternatives

To add the finalized virtual index sets to the list of alternatives in SQL Optimizer, click OK.

The index sets display as alternatives in the Run Time pane on the SQL Optimizer window. From here, you can compare the index sets with other index sets and SQL alternatives to determine the best-performing alternative.

 

Analyze the Impact of New Indexes

Analyzing the impact of new indexes on other SQL statements before physically creating them on your database is essential. As new indexes may improve the performance of one SQL but downgrade the performance of others.

To analyze the impact of new indexes

  1. From the SQL Optimizer window, generate or create the virtual index sets for your original SQL statement:

  2. Before performing the Impact Analysis function, check that you have a good sample of SQL statements stored in the SQL Repository. Analysis is based on the SQL statements stored the repository. Therefore, the SQL repository should contain a good sample of SQL statements that maybe affected by the new indexes if they were to be created.

  3. In Run Time pane, select the index- set alternative that offers the best performance for your SQL statement.
  4. Click image\B_ImpactAnalysis.gif. The Index Impact Analyzer window will be opened followed by the New Analysis wizard.

  5. Follow the New Analysis wizard using the following pages to select the options for creating the analysis.

Analyzer

Selected SQL

Index

 

Generate a Report for Optimized SQL

The details of the SQL and index-set alternatives and their run-time results can be generated into a report.

To generate the Optimized SQL Report

  1. Select Report | Optimized SQL to open the Optimized SQL Report Criteria window.

  2. Select the components for the report.

  3. Click OK to generate the report.

  4. The information in the report can be Saved and Printed.

Note: A few minutes may be needed to generate a long report.

 

 

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating