简体   繁体   English

真的很慢的密码查询(neo4j)

[英]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: 该图由6个用户节点,6个页面节点和总共12个关系组成:

  • Person isFriendOf Person; 人是人的朋友;
  • Person likes Page; 人喜欢佩奇;

This doesn't look like normal behaviour. 这看起来不正常。 What could be the root cause of this? 这可能是根本原因?

Problem solved. 问题解决了。

The performance issue was caused by using not a global or threadlocal ExecutionEngine. 性能问题是由于未使用全局或本地线程的ExecutionEngine引起的。 Do not create an ExecutionEngine per request but always thread local (or global) otherwise you will kill the cache. 不要为每个请求创建一个ExecutionEngine,而是始终线程本地(或全局)线程,否则您将终止缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM