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.

Strategy for matching 6 million nodes

Hi,

I have 6 mill nodes "Equipment" that I want to relate to 60.000 node "Product" by matching on 2 properties (.Manufacturer and .Model) that are common on both node types. Properties are indexed on both node types

This is time-consuming and prone to cause out-of-memory errors, are there any tricks I can apply?
I have tried
CALL apoc.periodic.iterate("
....
",{batchSize:10000, parallel:false})

1 ACCEPTED SOLUTION

Hi @bent.s.lund

The first step is to create indexes like this.

CREATE INDEX equipment_index FOR (n:Equipment) ON (n.Manufacturer, n.Model);
CREATE INDEX product_index FOR (n:Product) ON (n.Manufacturer, n.Model);

The "CALL apoc.periodic.iterate(" works fine even for nearly 100 million data.

View solution in original post

2 REPLIES 2

Hi @bent.s.lund

The first step is to create indexes like this.

CREATE INDEX equipment_index FOR (n:Equipment) ON (n.Manufacturer, n.Model);
CREATE INDEX product_index FOR (n:Product) ON (n.Manufacturer, n.Model);

The "CALL apoc.periodic.iterate(" works fine even for nearly 100 million data.

Thanks koji,
you confirmed that my approach on this was correct! I must have done something wrong maybe with the indexes - when I tried again I was able to match and create relations between nodes.
Thanks for your help!