Creating Secondary Indexes 

Procedure

  1. In the field maintenance screen for the table, choose Goto ® Indexes.
  2. If indexes already exist on the table, a list of these indexes is displayed. Choose Create. A dialog box appears in which you must enter the three-place index identifier.

  3. Enter the index identifier and choose Continue.
  4. You will go to the maintenance screen for indexes.

  5. Enter a short explanatory text in the field Short description and select TabFields.
  6. A list of all the fields of the table is displayed.

  7. Select the fields that you want to copy to the index and choose Copy.
  8. The selected fields are copied to the index.

  9. If the values in the index fields already uniquely identify each record of the table, select Unique index.
  10. A unique index is always created in the database at activation because it also has a functional meaning (prevents double entries of the index fields).

  11. If it is not a unique index, leave Non-unique index selected. In this case you can use the radio buttons to define whether the index should be created for all database systems, for selected database systems or not at all in the database.
  12. If you chose For selected database systems, you must specify these systems. You have two options here:

    Selection list: The index is only created automatically at activation for the database systems specified in the list. The index is not created in the database for all other database systems.

    Exclusion list: The index is not created automatically in the database at activation for the specified database systems. The index is automatically created in the database for all other database systems.

  13. Click on the arrow behind the radio buttons.
  14. A dialog box appears in which you can define up to 4 database systems. Use the input help for the first field to select the database systems. With the corresponding radio buttons you can decide whether this list should be treated as a selection list or an exclusion list.

  15. Activate the index with Index ® Activate.

Information on the activation process can be found in the activation log. You can call the activation log with Utilities ® Activation log. If errors occurred when activating the secondary index, the activation log is automatically displayed.

Result

The secondary index is automatically created in the database during activation if the corresponding table was already created there and index creation was not excluded for the database system.

If possible, check whether the database actually uses the index you created for selection. This is described in How to Check if an Index is Used.