cancel
Showing results for 
Search instead for 
Did you mean: 

Optimize query with 2 depth

ff
Node

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.

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.