使用Neo4j批量插入

mta*_*riq 5 java mysql graph batch-processing neo4j

我从表中导入了2.3亿个关系,导入速度不是很快,每小时需要5Million才能完成迁移需要20天.我听说过neo4j批量插入和批量插入实用程序.该实用程序通过从csv文件导入来做有趣的事情,但最新的代码是一些破坏和不运行的.

我在neo4j中有大约100M的关系,我必须检查是否没有重复的关系.

我怎样才能加快neo4j的速度

按当前代码就好

begin transaction
for 50K relationships
create or get user node for user A
create or get user node for user B
check there is relationship KNOW between A to B if not create the relationhsip
end transaction
Run Code Online (Sandbox Code Playgroud)

我还阅读了以下内容:

Mat*_*nné 0

如何从索引中查找“获取用户 A 的用户节点”?索引查找确实会减慢批量插入的速度。尝试在索引“前面”的简单 HashMap 中缓存尽可能大的用户部分,或者使用 BatchInserterIndex#setCacheCapacity