Indexes
In Neo4j, indexes are used to find the starting points of the queries. You can count on them. Indexes are automatically created on properties that have a constraint. Otherwise, you can create an index with a query like the following:
CREATE INDEX ON :LabelName(propertyName)
However, refrain from creating an index for every property of each label as they need to be maintained by the server when data is inserted. It is taken care of here, but there is no magic.
The command to get the list of indexes in use in your graph is as follows:
CALL db.indexes
Force index usage
You may force the use of an index by specifying it in your query, as follows:
MATCH (t:Tower {name: ""})
USING INDEX t:Tower(name)
RETURN ...
Force label usage
You may also force the planner to start by evaluating nodes for a label instead of an index. This is particularly useful if you are querying for nodes having two labels and you know that one of the labels is more restrictive than the other. In this example, we could...