I want to find all the paths from the leaf node(E) to the root node(A).
Not for any specific node so no id or filed filter here.
The data model is as shown in the screenshot.
I used a basic Cypher query to find the paths:
MATCH path=(:A)-[:USE*]->(:E) RETURN path
This is to return all the paths from A to E: It took 254 seconds to return 18k paths.
I also want to return paths from B, C, D to E. I have written this query for that
MATCH path=(n)-[:USE*]->(:E) RETURN path
How can I improve this traversal to return results in 10-15 seconds?
System memory is 16GB
Current Neo4j Conf:
heap size: min-3GB max-3GB
database size: 1.5GB