neo4j 节点已删除(但实际上没有)
neo4j Nodes Deleted (but not Actually)
我想通过执行
删除某个标签的所有节点
match (P:ALabel) delete P;
这 return 是评论 "No data returned." 它还说明删除了多少节点,以及花费了多长时间(5767 毫秒)。但是,shell 似乎在此之后停止响应,我无法执行任何其他命令。
我也使用了这个命令,受到 this answer:
的鼓励
match (n:ALabel)
optional match (n)-[r]-()
delete n, r;
执行此命令花费的时间稍长(16929 毫秒)。它仍然没有return。
根据您需要选择合适的事务大小的更改量,否则您会看到过多的垃圾回收 and/or OOM 异常。使用 LIMIT
子句和 return 返回删除的节点数。 运行 这个语句多次直到 0 被 returned:
match (n:ALabel)
with n limit 5000
optional match (n)-[r]-()
delete n,r
return count(distinct n)
此处批量大小为 5000 个节点。
我想通过执行
删除某个标签的所有节点match (P:ALabel) delete P;
这 return 是评论 "No data returned." 它还说明删除了多少节点,以及花费了多长时间(5767 毫秒)。但是,shell 似乎在此之后停止响应,我无法执行任何其他命令。
我也使用了这个命令,受到 this answer:
的鼓励match (n:ALabel)
optional match (n)-[r]-()
delete n, r;
执行此命令花费的时间稍长(16929 毫秒)。它仍然没有return。
根据您需要选择合适的事务大小的更改量,否则您会看到过多的垃圾回收 and/or OOM 异常。使用 LIMIT
子句和 return 返回删除的节点数。 运行 这个语句多次直到 0 被 returned:
match (n:ALabel)
with n limit 5000
optional match (n)-[r]-()
delete n,r
return count(distinct n)
此处批量大小为 5000 个节点。