2015-12-03 129 views
0

我試圖使用批量導入模塊將數據導入Neo4j 2.2.5,但速度很慢。我究竟做錯了什麼?加速Neo4j批量導入

我有3個獨立的CSV文件是從SQL數據庫轉儲。最大的有2M +行。這裏是我的導入腳本:

//Load the messages 
create index on :Mail(id); 
import-cypher -d"\t" -i file:c:/messagesheaders.csv -b 10000 -q with distinct {mid} as mid merge (e:Mail {id: {mid}, date: {date}, message_id: {message_id}}); 

//Load recipients 
create index on :Person(Email); 
import-cypher -d"\t" -i file:c:/recipientsheaders.csv -b 10000 -q create (e:Person {Email: {rvalue}}); 

//Load senders 
create index on :Person(Email); 
import-cypher -d"\t" -i file:c:/messagesheaders.csv -b 10000 -q with distinct {sender} as sender merge (e:Person {Email: {sender}}); 

//Relationships between senders and mails 
import-cypher -d"\t" -i file:c:/messagesheaders.csv -b 10000 -q match (e:Person {Email: {sender}}), (c:Mail {id: {mid}}) create (e)-[:HAS_SENT]->(c); 

//Relationships between recipients and mails 
import-cypher -d"\t" -i file:c:/recipientsheaders.csv -b 10000 -q match (e:Person {Email: {rvalue}}), (d:Mail {id: {mid}}) create (e)-[:HAS_RECEIVED {rtype: {rtype}}]->(d); 

我可以導入節點不錯,但1小時後的Neo4j還停留在第一組的關係。我怎樣才能加快速度?

回答