Show TOC Start of Content Area

Procedure documentation Creating Indexes  Locate the document in its SAP Library structure

Use

An index is a copy of a database table that is reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example, when using a binary search. A table has a primary index and a secondary index. The primary index consists of the key fields of the table and is automatically created in the database along with the table. You can also create further indexes on a table in the Java Dictionary. These are called secondary indexes. This is necessary if the table is frequently accessed in a way that does not take advantage of the primary index. Different indexes for the same table are distinguished from one another by a separate index name. The index name must be unique. Whether or not an index is used to access a particular table, is decided by the database system optimizer. This means that an index might improve performance only with certain database systems. You specify if the index should be used on certain database systems in the index definition. Indexes for a table are created when the table is created (provided that the table is not excluded for the database system in the index definition). If the index fields represent the primary keys of the table, that is, if they already uniquely identify each record of the table, the index is referred to as an unique index.

Prerequisites

You have opened a table for edit.

Procedure

Creating Indexes

...

       1.      Choose the Indexes tab.

       2.      To create an index, choose This graphic is explained in the accompanying text. The New Index dialog opens.

       3.      Complete the Prefix and Suffix fields. The Index Name field is updated with the index name constructed from the prefix and suffix.

Caution

If the name of an index was registered on the name server, it cannot be deleted.

       4.      Choose Finish. The index appears in the list in the Indexes tab.

       5.      Expand the index tree node.

       6.      To add table fields to the index, select Fields and choose Add/Edit Index Fields from the context menu. The Edit Fields dialog opens.

       7.      To add table fields to the index, select the appropriate checkboxes. Choose Finish.

      To change the order of fields in the index, select a field and choose Up or Down from the context menu.

      To remove a field from the index, select a field and choose Remove Index Fields from the context menu.

       8.      To specify if the index should be used on a certain database, expand the Properties sub-tree.

      The Included Databases sub-tree lists all databases that the index is used on. To exclude the index on a database, select the database and choose Do Not Create On Database from the context menu. The database appears in the Excluded Databases sub-tree.

      The Excluded Databases sub-tree lists all databases that the index is not used on. To use the  index on a database, select the database and choose Create On Database from the context menu. The database appears in the Included Databases sub-tree.

       9.      To specify if the index is unique or not, select Unique and choose Toggle Unique Index from the context menu.

   10.      Choose Save.

 

 

 

End of Content Area