I have a graph of more than 1 M nodes, and try to find the nodes at two depth with multiple relation. Always hit out of heap space error when trying to run. Is there anyway to optmize the query?
MATCH (a:person)-[r1:relation]->(b:customer)-[r2:relation]->(c:person)
WITH a,c,count(b) as cnt, sum(r1.weight) as sum1, sum(r2.weight) as sum2
WHERE cnt > 5 and sum1+sum2>10000
new to neo4j, a lot of questions.