Create an index

To create an index

  1. In the System i Navigator window, expand the system you want to use.
  2. Expand Databases.
  3. Expand the database and schema that you want to work with.
  4. Right-click the Indexes container and select New, then Index.
  5. In the Index name field, specify a name for the new index.
  6. In the Index schema field, select the schema where the index will reside.
  7. In the Table name field, select the table that you want to create an index for. To select a table from a different schema, change the schema name in the Table schema field.
  8. Select which columns of the table will make up the index. To add a column, click on it and a number appears on the left. The number determines the key position of the column in the index. You can change the order of the columns by selecting it and clicking Move up or Move down. To remove a column from the index, click on it again.
  9. To change the order of a key column from ascending sequence to descending sequence (or descending to ascending sequence), select the column and click Set Ascending or Set Descending.
  10. Select an Index type. See Index type for details.
  11. Select the Number of distinct values if you are creating an encoded vector index. See Number of distinct values for details.
  12. Click OK.

Note: You can also create an index by right-clicking on a table or view, the All objects container, or a schema object and selecting New, then Index.