Skip to main content
We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.

Indexing

An index is an optimized data structure, stored on disk and loaded into memory, that speeds or optimizes query processing. It is created and stored in addition to the primary data. E.g. a β€œhasName” property or relation is the primary storage structure for a graph in Dgraph, but may also have an additional index structure configured. Typically, Dgraph query access is optimized for forward access. When other access is needed, an index may speed up queries. Indexes are large structures that hold all values for some Relation (vs Posting Lists, which are typically smaller, per-Node structures).

Tokenizers

Tokenizers are simply small algorithms that create indexed values from some Node property. E.g. if a Book Node has a Title attribute, and you add a β€œterm” index, each word (term) in the text will be indexed. The word β€œTokenizer” derives its name from tokenizing operations to create this index type. Similarly, if the Book has a publicationDateTime you can add a day or year index. The β€œtokenizer” here extracts the value to be indexed, which may be the day or hour of the dateTime, or only the year.
⌘I