Neo4j 2.0 Merge with unique constraints performance bug?

荒凉一梦 提交于 2019-12-02 04:32:45

Constraint checks are more expensive than just inserts. They also take a global lock on the constraint to prevent multiple insertion.

I saw you don't use parameters, but string substitiution, I really recommend to change that and go with parameters.

Also setting the whole node c to n triggers constraint check again.

Your probably want to use the ON CREATE SET clause of MERGE

(n in {nodes} |  
MERGE (c:Label {key : n.key}}) ON CREATE SET c.foo = n.foo, c.bar = n.bar )
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!