cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Loading in millions of nodes

Hi everyone,

I'm trying to load in a large dataset with about 6 million rows. on each row, I want to create 3000 relationships to other nodes.

At first, I tried to run each connection 1 by 1 but this took a long time so I try to merge all 3000 relationships in one command but this is still taking too long. I have indexes for all properties I'm merging on. Is there any way to speed up the queries?

an example of a query for a single row:

MATCH (snp:SNP where id(snp)=2222222) MERGE (NA21112:Sample {id: 21112})-[r21112:has_SNP {format: 'gt', genotype: '0|0'}]->(snp) MERGE (NA21113:Sample {id: 21113})-[r21113:has_SNP {format: 'gt', genotype: '0|0'}]->(snp) ... thousands more ... return snp

Please let me know if I can do anything to optimize this. I'm using neo4j 3.5 with the python neo4j driver.

Julian

0 REPLIES 0