如何加快从MySQL插入neo4j的速度? [英] how to speed up insertion in neo4j from mysql?

查看:267
本文介绍了如何加快从MySQL插入neo4j的速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mysql中有60000个项目的数据集,我正在尝试将其插入neo4j.插入正在进行中,但需要很长时间(每3秒大约10-15).有什么办法可以加快速度吗?还有什么办法可以给我一些东西,例如neo4j中的唯一键,这样重复索引就不会被索引?我是neo4j的新手.

I have a dataset of 60000 items in mysql and i'm trying to insert it into neo4j. The insertion is taking place but it's taking a long time( approx. 10-15 per 3 sec). Is there any way i can speed it up? also is there any way i could give something such as unique key in neo4j so duplication indexes won't get indexed? I'm new to neo4j.

我正在将neo4j 1.8与PHP Everyman驱动程序配合使用.

I'm using neo4j 1.8 with PHP Everyman driver.

推荐答案

如上所述,首选选项是批处理导入器.

As mentioned above, the preferred option is the batch importer.

如果您需要通过PHP客户端,这里我举了一个使用REST批处理api的示例: http://phpfiddle.org/main/code/mu3-sgk

If you need to go through the PHP client, here I've put up an example that uses the REST batch api: http://phpfiddle.org/main/code/mu3-sgk

您可以测试最适合您的系统的行/批次. 对于我的笔记本电脑是750,对于测试服务器是1250. 发生的json_decode在CPU上很累.

You can test the rows/batch what works best for your system. For my laptop it's 750, for my test-server it's 1250. The json_decode that happens is heavy on the CPU.

这篇关于如何加快从MySQL插入neo4j的速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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