epdittmer
epdittmer

Reputation: 498

Really slow cypher query (neo4j)

When executing the following cypher query:

START me=node(2) MATCH (me)-[:likes]->page<-[:likes]-(person) WHERE NOT(me-[:isFriendOf]-person) RETURN person

I am observing the following execution times:

163ms
173ms
177ms
210ms
174ms
etc.

The graph consist of 6 user nodes, 6 page nodes and a total of 12 relationships:

This doesn't look like normal behaviour. What could be the root cause of this?

Upvotes: 1

Views: 168

Answers (1)

epdittmer
epdittmer

Reputation: 498

Problem solved.

The performance issue was caused by using not a global or threadlocal ExecutionEngine. Do not create an ExecutionEngine per request but always thread local (or global) otherwise you will kill the cache.

Upvotes: 2

Related Questions