Administration Guide

SQL Advise Facility

The Index Advisor is a management tool that reduces the need for you to design and define suitable indexes for your data.

The Index Advisor is good for:

There are concepts associated with the SQL Advise Facility. First, there is a workload. A workload is a set of SQL statements which the database manager has to process over a given period of time. The SQL statements can include: SELECT, INSERT, UPDATE, and DELETE statements. For example, over a one month period of time your database manager may have to process 1 000 INSERTs, 10 000 UPDATEs, 10 000 SELECTs, and 1 000 DELETEs. The information in the workload is concerned with the type and frequency of the SQL statements over a given period of time. The advising engine uses this workload information in conjunction with the database information to recommend indexes. The goal of the advising engine is to minimize the total workload cost.

Second, there is a concept of a virtual index. Virtual indexes are indexes which do not exist in the current database schema. These indexes could be either recommendations that the Advise Facility has made to you, or indexes that you are looking to the Advise Facility to evaluate for you. These indexes could also be those the Advise Facility considers as part of the process and then discards because they are not going to be recommended. Virtual indexes are passed back and forth from you to the Advise Facility using the ADVISE_INDEX table.

The Advise Facility uses a workload and statistics from the database to generate recommended indexes.

The Advise Facility uses two EXPLAIN tables:

Note:To create these table, run the EXPLAIN.DDL script found in the misc subdirectory of the sqllib subdirectory. If not already created, the Index wizard can also create these table.

The process for using the Index Advisor involves inputs, invocation of the advisor, outputs, and some special cases that should be considered.

There are three ways to create the input for the Index Advisor:

There are four ways to invoke the Index Advisor:

There are different ways to use the results from the advisor:

To get better recommendations for a specific query, it is suggested that you advise that query by itself. You can use the Index wizard to recommend indexes for a single query by building a workload which contains only that query.

A sample workload can be collected from Event Monitor output. The Event Monitor can be used to collect dynamic SQL executions. Then these statements can be fed back to the Advise Facility.

The Index wizard is a simple, straight-forward, easy to use, visual interface providing an excellent way to access the Advise Facility.


[ Top of Page | Previous Page | Next Page ]