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

查看:102
本文介绍了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 毫秒:

路径,2500 毫秒:

一开始我以为是资源不足的问题,因为我在同一个机器上运行neo4j和我的应用程序.虽然性能监视器表明 CPU 和内存大部分已释放并可用,但我将 neo4j 服务器移至另一个本地机器并观察到类似的延迟.两台服务器都是工作站,配备相当新的至强处理器、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.

粘贴链接:

推荐答案

[对我之前发表的评论进行一点扩展.]

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

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

@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天全站免登陆