Try OpenEdge Now
skip to main content
ABL Database Triggers and Indexes
Database Index Usage : Finding out which indexes are used
 

Finding out which indexes are used

To find out which indexes the AVM will uses at run time for a particular query, use the XREF option in the COMPILE statement. The SEARCH lines in the XREF output file show the indexes that are accessed for every record selection statement.
The following table provides a list of tags the XREF compile option generates.
Table 1. XREF tags
Tag
Meaning
SEARCH
Indicates an index bracket or look up will be used. The logical database name, table name, and index names are listed. When multiple brackets and indexes are used for the same query, you will see one search line for each bracket.
SEARCH ... WHOLE-INDEX
Indicates that a suitable bracket could not be constructed and an index scan over the entire table will be performed using the index noted.
SEARCH ... TABLE-SCAN
Indicates that a scan is performed over the entire table without using index.
SORT-ACCESS
Indicates that the query result is to be ordered by a particular column value and no suitable index exists. A sort of the query result on the noted column value is required.
ACCESS
Indicates that the specified table and field value is used at this point in the program.
CREATE
Indicates that a record is created at this location in the program.
DELETE
Indicates that a record is deleted at this location in the program.
UPDATE
Indicates that the specified field value of a table is updated at this location in the program.
An alternative method to determine index usage is to use the index statistics virtual system table. The startup parameters that enable this are described in OpenEdge Data Management: Database Administration.