Create a secondary index called ITM_RELEASE_DATE on the RELEASE_DATE column in the ITEMS table:
CREATE INDEX itm_release_date ON items(release_date);
Primary key columns may also be included in a secondary index. If a table has the primary key
columns A, B, and C, the primary index would cover all three columns of the primary key.
The following combinations of the columns in the primary key are automatically indexed: A, AB, and
ABC. In addition, you could create secondary indexes on columns B, C, BC, AC etc.
An index may also be defined as UNIQUE, which means that the index value may only occur once in the
table. (For this purpose, NULL is treated as equal to NULL). However, it is preferable to use unique
Create a UNIQUE secondary index called ITM_EAN_CODE on the EAN_CODE column in the ITEMS table:
CREATE UNIQUE INDEX itm_ean_code ON ITEMS(ean_code);
The sorting order for indexes may be defined as ascending or descending. However, this makes no
difference to the efficiency of the index, since Mimer SQL searches indexes forwards or backwards
depending on the circumstances.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/10599713/viewspace-983310/，如需转载，请注明出处，否则将追究法律责任。