Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-22-2022 08:20 PM
Hi everyone,
I have the below query to load 4mb of json data and it got stuck without any warning or error only kept on spinning.
If anybody can help or suggest me a solution that will be helpful.
You can directly run the query if you want to check
CALL apoc.periodic.iterate(
"CALL apoc.load.json('https://s3.eu-central-1.amazonaws.com/demo.hcpspace.app/bulk_connections.json')
YIELD value as row",
"MERGE(n:People{uuid: row.uuid})
WITH n,row
UNWIND row.uuids as uuid
MERGE(p:People{uuid: uuid})
MERGE(n)-[:FOLLOW]->(p)",
{batchSize:100, parallel:true})
Solved! Go to Solution.
09-22-2022 08:35 PM
If you execute the apoc.load.json and look at the results, there are 70,251 records. I tried your query and it kept spinning. I add the following index and it completed in around 7 sec.
CREATE INDEX ON :People(uuid)
I would say the problem is the MERGE statements that have to look up the node by 'uuid'. Without the index this is a node scan, which takes longer and longer as the number of nodes increases.
09-22-2022 08:35 PM
If you execute the apoc.load.json and look at the results, there are 70,251 records. I tried your query and it kept spinning. I add the following index and it completed in around 7 sec.
CREATE INDEX ON :People(uuid)
I would say the problem is the MERGE statements that have to look up the node by 'uuid'. Without the index this is a node scan, which takes longer and longer as the number of nodes increases.
09-23-2022 05:09 AM
I totally forgot to create index. I was recreating the db and forgot to add index. Thank you for pointing out
All the sessions of the conference are now available online