Indexes​

This section describes the SDL declarations pertaining to indexes.

Example​

Declare an index for a “User” based on the “name” property:

  1. type User {
  2. required property name -> str;
  3. property address -> str;
  4. multi link friends -> User;
  5. # define an index for User based on name
  6. index on (.name) {
  7. annotation title := 'User name index';
  8. }
  9. }

Syntax​

Define a new index corresponding to the more explicit DDL commands.

  1. index on ( index-expr )
  2. [ "{" annotation-declarations "}" ] ;

Description​

This declaration defines a new index with the following options:

on ( index-expr )

The specific expression for which the index is made. Note also that <index-expr> itself has to be parenthesized.

The valid SDL sub-declarations are listed below:

annotation-declarations

Set index annotation to a given value.

See also

Schema > Indexes

DDL > Indexes

Introspection > Indexes