Neo4j indexes are used to easily find the start node of a pattern matching query. Let's see the impact of creating an index on the execution plan and execution time:
CREATE INDEX ON :Person(id)
And let's run our query again:
PROFILE
MATCH (p:Person { id: 1000})
RETURN p
You can see that the query is now using our index through the NodeIndexSeek operation, which reduces the execution time to 1 ms:
An index can also be dropped with the following statement:
DROP INDEX ON :Person(id)
The Neo4j indexing system also supports combined indexes and full-text indexes. Check https://neo4j.com/docs/cypher-manual/current/schema/index/ for more information.