graph databases - neo4j Nodes Deleted (but not Actually) -
i delete nodes of label executing
match (p:alabel) delete p;
this returns comment "no data returned." states how many nodes deleted, , how long took (5767 ms). however, shell seems stop responding after this, , unable execute other commands.
i used command, encouraged this answer:
match (n:alabel) optional match (n)-[r]-() delete n, r;
executing command took longer (16929 ms). still not return.
depending on amount of changes need choose appropriate transaction size, otherwise you'll see excessive garbage collections and/or oom exceptions. use limit
clause , return number of deleted nodes. run statement multiple times until 0 returned:
match (n:alabel) n limit 5000 optional match (n)-[r]-() delete n,r return count(distinct n)
here batch size 5000 nodes.
Comments
Post a Comment