Syntax:
CREATE [ LARGE ][ UNIQUE ] INDEX [ IF NOT EXISTS ] [ [catalog-name.]index-name ] ON [catalog-name.]table-name ( column name [, column-name ]* ) column-name: name [ COLLATE collation-name ] [ ASC | DESC ]
The CREATE INDEX creates an index on the specified table using the provided list of columns for the index key. Every index is unique within the indexed table. Each column name can be followed by ASC or DESC keyword to indicate sorting order, but the sorting order is ignored in the current implementation. Sorting is always done in the ascending order. If the name of the index is not defined then the index will be named with an automatically generated unique name.
The LARGE keyword is redundant in GDBase versions later than 20.02.2012 and is retained only for compatibility with older versions.
The COLLATE clause following each column name defines a collating sequence used for text entires in that column. The default collating sequence is the collating sequence defined for that column in the CREATE TABLE statement. If no collating sequence is otherwise defined, the built-in BINARY collating sequence is used.
There are no arbitrary limits on the number of indices that can be attached to a single table, nor on the number of columns in an index.
If the UNIQUE keyword is used then duplicate index entries are not allowed. Any attempt to insert a duplicate entry will result in an error.
If the optional IF NOT EXISTS clause is present and another index with the same name aleady exists, then this command becomes a no-op.
Indexes are removed with the DROP INDEX command.