简体   繁体   中英

Neo4j Importing CSV File(neo.TransientError.General.OutOfMemoryError)

Good day. I am new to neo4j and taking time to explore things however I got stuck with loading data from csv.

I am trying to load 200k data using Load csv function with using periodic commit options but it takes time to load and pops ('neo.TransientError.General.OutOfMemoryError') . Please find the code which I am using to load it:

USING PERIODIC COMMIT 500 LOAD CSV WITH HEADERS FROM "file:///C:/tree.csv" as Real MERGE(P:person{name:Real.ParentNode}) MERGE(C1:person{name:Real.ChildNode})
MERGE(P)-[REL:relation_of]->(C1)
RETURN P,C1,REL

As per community blog have changed the heap size of my db to 16G but still no change on the output(It taking too much time to run). Appreciate your inputs on this to overcome the error.

Thanks much!

The first thing to check would be have you set indexes on your 'unique' properties? In this example, those would be on person.name

Information on indexes is here .

The next thing to bear aware of is eager queries. Mark Needham has done an excellent post on this. He describes splitting out part of your LOAD CSV query to avoid out of memory challenges.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM