neo4j的所有查询都很慢 [英] All queries are slow with neo4j

查看:651
本文介绍了neo4j的所有查询都很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用cypher编写了各种查询,每个查询不少于200毫秒.它们非常简单明了,因此我很难确定瓶颈在哪里.

I have written a variety of queries using cypher that take no less than 200ms per query. They're very straightforward, so I'm having trouble identifying where the bottleneck is.

带参数的简单匹配,2200毫秒:

带参数的简单唯一匹配,200毫秒:

路径,2500ms:

起初,我认为问题是资源不足,因为我在同一盒子上运行neo4j和我的应用程序.当性能监视器显示CPU和内存在很大程度上已释放并可用时,我将neo4j服务器移到了另一个本地机器上,并观察到类似的延迟.这两台服务器都是具有全新Xeon处理器,12GB内存和用于数据存储的SSD的工作站.以上所有这些使我相信延迟不是由我的硬件引起的.操作系统是Windows 7.

At first I thought the issue was a lack of resources, because I was running neo4j and my application on the same box. While the performance monitor indicated that CPU and memory were largely free'd up and available, I moved the neo4j server to another local box and observed similar latency. Both servers are workstations with fairly new Xeon processors, 12GB memory and SSDs for the data storage. All of the above leads me to believe that the latency isn't due to my hardware. OS is Windows 7.

该图的节点少于200个,关系少于200个.

The graph has less than 200 nodes and less than 200 relationships.

我附加了一些发送给neo4j的查询以及服务器,数据库和JVM的配置.没有插件或扩展程序被加载.

I've attached some queries that I send to neo4j along with the configuration for the server, database, and JVM. No plugins or extensions are loaded.

Pastebin链接:

Pastebin Links:

  • Database Configuration
  • Server Configuration
  • JVM Configuration

推荐答案

[在我之前发表的评论中稍加扩展.]

[Expanding a bit on a comment I made earlier.]

@TFerrell:您的评论指出所有节点都有标签",并且您尝试应用索引.但是,尚不清楚您是否在慢速密码查询中实际指定了标签.我从您的原始问题陈述中注意到,您的慢速查询都没有实际指定节点标签(大概应该是项目").

@TFerrell: Your comments state that "all nodes have labels", and that you tried applying indexes. However, it is not clear if you actually specified the labels in your slow Cypher queries. I noticed from your original question statement that neither of your slower queries actually specified a node label (which presumably should have been "Project").

如果您的Cypher查询未指定节点的标签,则数据库引擎必须测试每个节点,并且也无法应用索引.

If your Cypher query does not specify the label for a node, then the DB engine has to test every node, and it also cannot apply an index.

因此,请尝试在慢速查询中指定正确的节点标签.

So, please try specifying the correct node label(s) in your slow queries.

这篇关于neo4j的所有查询都很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆