[Neo4j] how to avoid circular paths and return all nearby users by hops

2016-07-11 Thread idor
I have the following query with the following conditions: MATCH (me:User {userId:})-[:friend*0..3]-(nearby:User) WITH COLLECT(DISTINCT nearby) as users - 500 msg/sec - m4.large (Amazon machine, 2 cpu , 8 RAM) - 1 million nodes on graph - Each node is connected to

Re: [Neo4j] Optimizing ShortestPath query for a better performances

2016-06-26 Thread idor
n%2BShot%2B2016-06-26%2Bat%2B1.29.38%2BPM.png> On Sunday, June 26, 2016 at 12:46:43 AM UTC+3, Michael Hunger wrote: > > > > On Sat, Jun 25, 2016 at 10:23 PM, idor <idan...@gmail.com > > wrote: > >> Hi Michael, >> Thanks for replying. >> >> scale

Re: [Neo4j] Optimizing ShortestPath query for a better performances

2016-06-25 Thread idor
[r:relation_type1|relation_type2|relation_3*1..3]-(friend:User) > WHERE friend <> user > RETURN friend.userId as userId, reduce(base = '', rel in r | base > + ' ' + rel.dist) as dist > > But you also know that this can potentially return a lot of data? e.g. of

[Neo4j] Optimizing ShortestPath query for a better performances

2016-06-25 Thread idor
I have in my graph ~1M nodes and ~1M relations. My motivation for query is to retrieve all related nodes(by 3 hops) of specific source node + aggregate properties within the response. I understood the shortestPath taking your sourceNode and query all other nodes(not necessarily related ones)