cypher - Neo4j - query performance degradation -
here query:
match (p:publisher)-[r:published]->(w:woka)-[s:authored]-(a:author) match (l:language)-[t:used]->(w:woka) (a.author_name =~ '.*camus.*' , a.author_name =~ '.*albert.*') return p.publisher_name, w.woka_title, a.author_name, l.language_name;
the first time executing result returned in 3.8 seconds. second execution couple minutes later result returned in 15.1 seconds. more executing longer response time. third execution response time increasing , several moments later getting results between 30 , 90 seconds.
i user of (development) database. no data added or deleted or changed there. no indexes dropped or created there. when closing 2 out of 3 connections database response time goes 15 seconds.
memory set 4gb init , max 8gb. server has 16gb total memory.
what happening here? why response time differs much?
how big graph? allocates lot of heap caching , there not enough space running queries without garbage collection.
i presume relationships 1:n, if not add with distinct p,w,a
in between 2 matches.
your query suboptimal, , create lot of intermediate results, can use profile
@ query plan.
try this:
profile match (a:author) (a.author_name =~ '.*camus.*' , a.author_name =~ '.*albert.*') match (p:publisher)-[:published]->(w:woka)<-[:authored]-(a) match (l:language)-[:used]->(w:woka) return p.publisher_name, w.woka_title, a.author_name, l.language_name;
Comments
Post a Comment