Neo4j Data Import Slowness

0

I have to load around 5M Records in the Neo4j DB so I broke the excel into the chunks of 100K the Data is in Tabular Format and I am using CyperShell for that but seems like it has been more than 8 hours and it's still stuck on the first chunk

I'm Using

USING PERIODIC COMMIT
LOAD CSV WITH HEADERS from 'file://aa.xlsx' as row
MERGE (p1:L1 {Name: row.sl1})
MERGE (p2:L2 {Name: row.sl2})
MERGE (p3:L3 {Name: row.sl3, Path:row.sl3a})
MERGE (p4:L4 {Name: row.sl4})
MERGE (p5:L4 {Name: row.tl1})
MERGE (p6:L3 {Name: row.tl2})
MERGE (p7:L2 {Name: row.tl3, Path:row.tl3a})
MERGE (p8:L1 {Name: row.tl4})
MERGE (p1)-[:s]->(p2)-[:s]->(p3)-[:s]->(p4)-[:it]->(p5)-[:t]->(p6)-[:t]->(p7)-[:t]->(p8)```

Can Anyone Suggest me the changes or alternate Method to load the data in a faster way

I even Looked at neo4j-admin import but I'm a bit confused how to format the below excel for the same

Data in Excel Format

Hello @rockySingh and welcome to the Neo4j community :slight_smile:

Did you use UNIQUE CONSTRAINT?

Otherwise, you should consider using it. It must be used on a single property and this will speed up loading. :slight_smile:

Regards,
Cobra

Hi @cobra The Data that I have is Already Unique

By Single Property do you mean I need to load the Nodes First for Each Label Individually then load the Relationships?

First, you must create a UNIQUE CONSTRAINT on your unique property

Then create nodes and relations :slight_smile:

Which property is unique in your data?