I have the following query with the following conditions:
MATCH (me:User {userId:<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 5 friends(nodes)(sometimes the same sometimes
not)
- userId is indexed and we using labels
- using neo4j 3.0.3 and bolt-driver
After load-testing and profiling the queries found out that the most basic
query doing all issues.
Basically since I have lots of circle paths between the target node and
it's friends the query does really bad with performances - very slow
queries (almot 2 seconds latency):
so for this graph:
<https://lh3.googleusercontent.com/-ie9gnolKdBc/V4NcMJPUYzI/AAAAAAAAOZE/F6Q2UoI0VmA2x54H4SFaAJEEU79mlZf4gCLcB/s1600/Screen%2BShot%2B2016-07-11%2Bat%2B11.43.41%2BAM.png>
I have the following profile result:
<https://lh3.googleusercontent.com/-GG6ZmlB1T7I/V4NcJXL1foI/AAAAAAAAOZA/25pUD4iFwIU0HI9Ornfs88sXFZ2mvkwAwCLcB/s1600/Screen%2BShot%2B2016-07-11%2Bat%2B8.28.06%2BAM.png>
We just need the friends list and one path btw target node to the friend
without traversing all paths around (let's assume "stop" on the first one)
so how can i avoid circular paths running on the query and return all
nearby users by 3 hops efficiently ?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.