0

我有一个中型 Neo4j 数据库,大约有 700000 个节点,每个节点上有 1-5 个传出关系。

如果我使用浏览器界面查询索引属性上的节点并查找相邻节点,大约需要 1500 毫秒,这对我来说很好。

MATCH (n {id_str : 'some_id'})-->(child) return child.id_str
...
Returned 2 rows in 1655 ms

但是,如果我使用 Ruby Neography 库运行类似的 Cypher 查询提及关系,则需要几分钟才能完成。

lookup_links = "MATCH (n {id_str : {id_str}})-[:internal_link]->(child) return child.id_str"
links = @neo.execute_query(lookup_links, :id_str => id_str)

在那之后,常规的浏览器查询也变得非常慢,每次大约需要两分钟。

MATCH (n2 {id_str : 'some_id'})-->(child) return child.id_str
Returned 2 rows in 116201 ms

我在 64 位 ubuntu 14.04 笔记本电脑上运行实验,8GB 内存和 1GB 堆用于 neo4j。Neo4j 版本是从官方 deb 包安装的 2.1.3。Neography 版本为 1.6.0。我使用 MRI-1.9.3。

当 neo 忙于为查询提供服务时,我使用 kill -3 完成了堆栈转储。 https://gist.github.com/akamaus/a06bc9e04c7209c480e9

任何想法出了什么问题以及如何调查它?

4

0 回答 0