I'm trying to find out why my cypher query is running so slow (2-5 seconds for only 5000 nodes). The query is trying to find all the jobs the a profile can reach inside his network (a job the his friends or his friends of friends work in the same company)
This is the query :
Start current_profile= node:node_auto_index(neoid_unique_id = "Profile:1")
Match current_profile-[r:friendships*0..2]->friends-[:roles]->company-[:positions]->jobs
return distinct company.fmj_id
I tried trimming down the query to see what I'm doing wrong and even this simple query takes too long:
START root=node(0)
Match root-[:job_subref]->j-[:jobs]->jobss
return jobss
Am I doing anything wrong?
I'm using neoid that is based on neography gem
The size of the available heap memory is an important aspect for the performance of Neo4j. Generally speaking, it is beneficial to configure a large enough heap space to sustain concurrent operations. For many setups, a heap size between 8G and 16G is large enough to run Neo4j reliably.
Neo4j has some upper bound limit for the graph size and can support tens of billions of nodes, properties, and relationships in a single graph. No security is provided at the data level and there is no data encryption. Security auditing is not available in Neo4j.
Execution Time is in seconds, for 1,000 users. For the simple friends of friends query, Neo4j is 60% faster than MySQL. For friends of friends of friends, Neo is 180 times faster. And for the depth four query, Neo4j is 1,135 times faster.
Tom's IT Pro in looking at 'Small to Big Data Solutions' notes that graph databases such as Neo4j would be better than Hadoop for some big data problems, particularly those described with networks and its relationships between objects.
What about trying this query
Start current_profile= node:node_auto_index(neoid_unique_id = "Profile:1")
Match current_profile-[r:friendships*0..2]->friends
WITH friends
friends-[:roles]->company-[:positions]->jobs
RETURN company.fmj_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With