CREATE INDEX
Creates an index
DSQL, ESQL
CREATE [UNIQUE] [ASC[ENDING] | DESC[ENDING]] INDEX indexname ON tablename {(col [, col ...]) | COMPUTED BY (<expression>)} [WHERE <search_condition>]
Parameter | Description |
---|---|
indexname |
Index name.The maximum length is 63 characters |
tablename |
The name of the table for which the index is to be built |
col |
Name of a column in the table.Columns of the types |
expression |
The expression that will compute the values for a computed index, also known as an “expression index” |
search_condition |
Conditional expression of a partial index, to filter the rows to include in the index. |
The CREATE INDEX
statement creates an index for a table that can be used to speed up searching, sorting and grouping.Indexes are created automatically in the process of defining constraints, such as primary key, foreign key or unique constraints.
An index can be built on the content of columns of any data type except for BLOB
and arrays.The name (identifier) of an index must be unique among all index names.