in the case of relationships, and suppose you have enough memory, I would try not to create unique relationships at the import stage - right now I'm actually importing an SQL table with ~ 3 million records, but I always create relationships and it doesnβt matter if it is a duplicate or no.
you can later, after importing, simply execute a cypher request that will delight a unique relationship like this:
START n=node(*) MATCH n-[:KNOW]-m CREATE UNIQUE n-[:KNOW2]-m;
and
START r=rel(*) where type(r)='KNOW' delete r;
at least this is my approach, and launching a later cypher request takes about a minute. the problem may be when you really have two node nodes, than the cypher request can get into a memory error (it depends on how much cache you configured for the neo4j mechanism)
source share