Determining unnecessary indexes
You can easily determine which indexes are being used for query optimization.
Before V5R3, it was difficult to determine unnecessary indexes. Using the Last Used Date was not dependable, as it was only updated when the logical file was opened using a native database application (for example, in an RPG application). Furthermore, it was difficult to find all the indexes over a physical file. Indexes are created as part of a keyed physical file, a keyed logical file, a join logical file, an SQL index, a primary key or unique constraint, or a referential constraint. However, you can now easily find all indexes and retrieve statistics on index usage as a result of new V5R3 iSeries™ Navigator and i5/OS® functionality. To assist you in tuning your performance, this function now produces statistics on index usage as well as index usage in a query.
To access this through the iSeries Navigator, navigate to: Database > Schemas > Tables. Right-click your table and select Show Indexes
You can also view the statistics through the Retrieve Member Description (QUSRMBRD) API.
In addition to all existing attributes of an index, four new fields have been added to the iSeries Navigator. Those four new fields are:
- Last Query Use
- States the timestamp when the index was last used to retrieve data for a query.
- Last Query Statistic Use
- States the timestamp when the index was last used to provide statistical information.
- Query Use Count
- Lists the number of instances the index was used in a query.
- Query Statistics Use
- Lists the number of instances the index was used for statistical information.
- Last Used Date
- The century and date this index was last used.
- Days Used Count
- The number of days the index was used. If the index does not have a last used date, the count is 0.
- Date Reset Days Used Count
- The date that the days used count was last reset. You can reset the days used by Change Object Description (CHGOBJD) command.
The fields start and stop counting based on your situation, or the actions you are currently performing on your system. The following list describes what might affect one or both of your counters:
- The SQE and CQE query engines increment both counters. As a result, the statistics field will be updated regardless of which query interface is used.
- A save and restore procedure does not reset the statistics counter if the index is restored over an existing index. If an index is restored that does not exist on the server, the statistics are reset.
Parent topic:
Indexes and the optimizer
Related reference
Starting a summary monitor
Related information
Retrieve Member Description (QUSRMBRD) API
Change Object Description (CHGOBJD) command