1

I used the Neo4j API to batch insert a few million records, which normally would take much longer if done individually. The import finished considerably faster but I do not see the millions of records I inserted. Does Neo4j keep some form of queue for the batch insertions and insert it over time?

If so, how can I see the progress of this queue? I am doing a count and I notice the records are increasing, but at a very slow pace.

I am using the Neography gem's batch insertion (https://github.com/maxdemarzi/neography/wiki/Batch) and the code that does the batch insert is below:

User.find_in_batches(batch_size: 500) do |group|
   $neo4j.batch(*group.map { |user| ["create_unique_node", "users", "id", user.id, user.graph_node_properties] })
end

Running Neo4j 2.1.2 enterprise edition on Ubuntu 12.04 LTS.

4

1 回答 1

0

完成插入后,您是否正确关闭了批量插入器?

您使用的是哪个 Neo4j 版本和操作系统?

还要确保您的内存配置正确。正确配置节点存储和关系存储的内存映射,请参阅Rik 的博客文章

它不是队列,而是直接写入那些记录。你如何“检查”和计数?您不能同时访问数据库。

你能分享你的代码吗?

于 2014-07-27T20:22:59.913 回答