用create更新峰值300/s,稳定100w+更新1小时左右,但是load csv更新100w数据就要两个小时,很奇怪
create 语句 val cql =“merge (n:Person{id:{id}}) \n” + “merge (p:Phone{phone:{phone}})\n” + “merge (n)-[r:HAS]->( p ) \n” + “set r.name={name},r.update_time={update_time}\n” + "return r.update_time" result = tx.run(cql,parameters(“id”,id,“phone”,phone,“name”,name,“update_time”,update_time))
load csv val cql = “USING PERIODIC COMMIT 300\n” + “load csv from {url} as line\n” + "merge (n:Person{id:line[0]}) " + “merge(p:Phone{phone:line[5]})\n” + “merge (n)-[r:HAS]->§ set r.name=line[1],r.update_time=line[3]\n” + "return count® as cnt" val result = session.run(cql, parameters(“url”, url))
USING PERIODIC COMMIT 300 这个值调到500会更慢
4 回复