In the first part of this article we dived deep into what indexes are currently available in ArangoDB (3.2 and 3.3), also briefly looking at what improvements are coming with ArangoDB 3.4. Read Part I here.
In this Part II, we are going to focus on how to actually add indexes to a data model and speed up specific queries.
Adding indexes to the data model
The goal of adding an extra index to the data model is to speed up a certain query or even multiple queries.
One of the first things that should be done during development of AQL queries should be to review the output of the
explain command. A query can be explained using ArangoDB’s WEB UI or from the ArangoShell. In the ArangoShell it is as simple as
query is the AQL query string. To explain a query which also has bind parameters, they need to be passed separately into the command, e.g.