cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to handle slow cypher for set date property on all relations?

I have a huge graph with 8 millions of nodes.
I want set constant date property on all of relations. but I can't do it.
i use apoc.periodic.iterate for chunking.
when i use this cypher, i/o bottleneck occurred.
my cypher:
call apoc.periodic.iterate("match (:Node)<-[r:Rel]-(:Node) return r", "set r.date="2019-01-01" ,
{batchSize:100, iterateList:true, parallel:true})
none of cpu and ram don't use. just i/o worked hard.

5 REPLIES 5

You won't benefit from parallel:true in this case.
Another thing to try is to prefix the first statement with cypher runtime=slotted. Otherwise it might use compiled runtime which has issues upon streaming its results.

I test below query on small graph:
call apoc.periodic.iterate("match (u:User)<-[f:FOLLOWS]-(:User) return f" , "return f" , {batchSize:100, iterateList:true})
it's take 17264 ms.
and then run :
call apoc.periodic.iterate("cypher runtime=slotted match (u:User)<-[f:FOLLOWS]-(:User) return f" , "return f" , {batchSize:100, iterateList:true})
it's take 36799 ms.
have I mistake?

Looks OK with me. Slotted is slower but you'll benefit from streaming. Try with setting date now.

ok. thanks.
I think it make faster.
I have another question. for huge data when i/o is large it's better to use cluster for Neo4j?

Neo4j Causal Cluster helps you scaling your reads, but doesn't speed up writes.