I am currently having a performance issue on a Neo4J request.
Here is the problem. I need to find users in the database from a large list. To do this, the uniqCode must match, OR the name and location (zip) must match.
Then I want to be able to merge this user with a node I create.
The query below works but it takes between 20 and 30 seconds for a list of 30 users and on real case, it will be necessary to pass a list of 5000 to 10000 users.
I specify that I indexed the uniqCode and the name of the users nodes.
UNWIND $users as row
MATCH (u:User)
WHERE u.uniqCode = row.uniqCode
OR (
apoc.text.clean(u.name) = row.name
AND EXISTS ((u)-[:IS]->(:Zip {name:row.zip}))
)
MERGE (u)<-[:IS]-(a:ParallelUser {id:row.uuid, name: u.name, uniqCode: row.uniqCode})
RETURN {name: a.name, uniqCode: a.uniqCode, id: a.id} AS ParallelUser
with params look like
[{uniqCode: "1234", name: "John Doe", zip: "1234", uuid: "1234"}, ...]
Thank you in advance for your help...