Query of load csv not completing even after 12 hours

前端 未结 1 1657
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-15 17:43

I have been using Neo4j for quite a while now. I ran this query earlier before my computer crashed 7 days ago and somehow unable to run it now. I need to create a graph data

相关标签:
1条回答
  • 2021-01-15 18:36
    1. MOST IMPORTANT: Create Index/Constraint on the key property.

    CREATE CONSTRAINT ON (t:Transaction) ASSERT t.id IS UNIQUE;

    1. Don't set the max heap size to full of system RAM. Set it to 50%.

    2. Try ON CREATE SET instead of SET.

    3. You can also use apoc.periodic.iterate to load the data, but USING PERIODIC COMMIT is also fine.

    4. Importantly, if you are 'USING PERIODIC COMMIT' and the query is not finishing or running out of memory, it is likely because of using Distinct. Avoid Distinct as duplicate transactions will be handled by MERGE.

    NOTE: (If you use apoc.periodic.iterate to MERGE nodes/relationships with parameter parallel=true then it fails with NULL POINTER EXCEPTION. use it carefully)

    Questioner edit: Removing Distinct in 3rd line for Transaction node and re-running the query worked!

    0 讨论(0)
提交回复
热议问题