Creating an index

Privileges

Only a table owner or a user with create index permission on a table can create an index.

StepsCreating a new index

  1. Select the table in the left pane.

  2. Select the Indexes Folder for the table in the right pane.

  3. Select File | New | Index. The Create a New Index wizard opens.

The Create a New Index wizard asks for the following information:

Table 23-1: Inputs to the create a new index wizard

Input

Description

Name

Name for the new index.

Columns

The columns on which to create the index.

Segment

Database segment on which to store the index. A clustered index must be created on the same segment as its table, otherwise, the table moves to the new segment.

Cache

Cache to which you want to bind the index.

Unique

Specifies that the index is unique and no two rows can have the same key (index) value. When this feature is checked, the system checks for duplicate key values when the index is created and each time data is added with an insert or update command. You cannot create a unique index on a column that includes duplicate values or more than one null value. This kind of index makes sense when the data itself is unique.

Clustered

Specifies that the index is clustered and has data, rather than pointers, in its leaf pages. A table can have only one clustered index.

Duplicate key

Accept or reject duplicate key values in a unique index.

Duplicate row

Accept or reject rows with duplicate values in a non-unique clustered index.

Fill factor

Set the fill factor as a percentage. Mutually exclusive with setting rows per page. See “Fill factor”.

Rows per page

Set the rows per page. Mutually exclusive with setting the fill factor. See “Maximum rows per page”.

Cache strategy

MRU or large buffer prefetch. See “Cache strategy”.

Is data sorted

Indicate if data in the table has already been sorted. See “Presorted data”.

Create local partitioned index

Select to partition local index

Name and segment of partitioned index

Name and segment of partion of local index. (Optional)

Shortcut

Select the Indexes folder. Double-click the Add Index icon.

NoteYou can also create a unique index as a unique constraint.

WARNING! Use the Duplicate Keys and Duplicate Rows features with caution. An update that creates a duplicate key row or a duplicate row can result in data being overwritten.