Creating Index from GUI

To add an index to a table, open that table, switch to the Indexes page of the Table window, and click Add Index button.

Creating a table index in Database Tour

After you click OK button, you will be asking for the index name. You can just confirm the application generated name if it suits you.

Creating Index Options

Index fieldsChoose fields to include to the index (except a case when index is based on expression).
PrimarySpecify either the index has to be primary key.
UniqueSpecify either the index must be unique.
DescendingSpecify either the index must store the key values in descending order.
Case sensitiveSpecify either the index must be case sensitive.
ExpressionSpecify either the index is based on expression instead of field / column list. When you choose this option, must fill the expression too.

Creating Index by SQL

Alternatively, you can create indexes by SQL means (except a few types of databases which does not support this). Most of relational databases allow to add an index by executing SQL command like this:

CREATE [UNIQUE] INDEX ix_deal_category_values_deal_category ON deal_category_values (deal_id, category_id)

or this (if primary key constraint based on index):

ALTER TABLE deal_category_values ADD CONSTRAINT pk_deal_category_values PRIMARY KEY (deal_id, category_id)

Please read your database documentation to learn the correct syntax and possible options.

See also

 Adding or Modifying Table Field

 Adding Table Constraint

 Adding Table Foreign Key

 Adding Table Partition

 Viewing and Editing Table Structure