Documentation/Graph Query Language
CREATE INDEX
The ‘CREATE INDEX’ statement creates an index of a given type attribute.
CREATE [ UNIQUE ] INDEX identifier
[ EDITION identifier ]
ON identifier ( index_attribute_list )
[ INDEXTYPE identifier]
- An index can be created by an identifier name followed by an optional edition name, the attribute name and an optional index type.
- A UNIQUE index creates a constraint index such that all attribute values inserted into the index must be distinct. An error occurs if you try to add a new attribute value that matches an already existing index key.
- You can have multiple indices on the same index_attribute_list using the ‘EDITION’ keyword. This allows you e.g. to have an ‘HashTable’ index for faster exact-match-lookups and a ‘BTree’ index for faster range-queries simultaneously. The query optimizer will select the appropriate index automatically.
- You can create a new index named ‘IDX_Name’ for the attribute ‘Name’ of the object ‘User’ by using the statement: ‘CREATE INDEX IDX_Name ON User (Name) INDEXTYPE HashTable’.
index_attribute_list
identifier [ ASC | DESC ] [, identifier [ ASC | DESC ] ]
- The ‘identifier’ is the name of an attribute
- ASC|DESC is the sort order of the index
