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})

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.

2 Likes

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!