Are auto-indices on (node or relationship) properties used by the Cypher execution engine when executing a filtering WHERE clause? If not, is there a way to tell Cypher to use them? What about for third-party (e.g., Lucene) indices?
Are auto-indices on (node or relationship) properties used by the Cypher execution engine when
Share
This is something that we’ve thought a lot about, but alas, not yet.
The indexing part of Neo4j is going to get an overhaul soon, and when that happens, we will tie Cypher closer to it, to be able to do this, and other interesting things (like heuristics to pick the right index to use).
You can do it manually though. If you have a
movies<-[:ACTS_IN]-actormodel, and you want all actor named Kevin Bacon that have participated in a movie, you can write it as:or, you can do the same with indexes:
Which one is the fastest is hard to tell. Depends.