I have an embedded neo4j server with ruby on rails.

These are the configurations:

neostore.nodestore.db.mapped_memory=25M
neostore.relationshipstore.db.mapped_memory=240M
neostore.propertystore.db.mapped_memory=230M
neostore.propertystore.db.strings.mapped_memory=1200M
neostore.propertystore.db.arrays.mapped_memory=130M

wrapper.java.initmemory=1024
wrapper.java.maxmemory=2048

There are around 15lakh movie nodes. The below query is taking around 5secs to 
execute.

MATCH (movie:Movie) 
WITH movie, toInt(movie.reviews_count) + toInt(movie.ratings_count) AS weight 
RETURN movie, weight as weight 
ORDER BY weight DESC 
SKIP skip_count 
LIMIT 10

Here the skip_count varies as the user scroll for the results.

and this another query which aims to get the movies from a particular 
director takes around 9secs

MATCH (movie:Movie) , (director:Director)-[:Directed]->(movie) 
WHERE  director.name =~ '(?i)DIRECTOR_NAME' 
WITH movie, toInt(movie.ratings_count) * toInt(movie.reviews_count) * 
toInt(movie.rating) AS total_weight
RETURN movie, total_weight 
ORDER BY total_weight DESC, movie.rating DESC  
LIMIT 10 

How can I reduce the query execution time?

-- 
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.

Reply via email to