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.
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 fields | Choose fields to include to the index (except a case when index is based on expression). |
Primary | Specify either the index has to be primary key. |
Unique | Specify either the index must be unique. |
Descending | Specify either the index must store the key values in descending order. |
Case sensitive | Specify either the index must be case sensitive. |
Expression | Specify 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