What would be the best way to delete 1000+ or 100000+ selected nodes? Should I use UNWIND and MATCH to get a list of the nodes I want to delete then detach delete them.
UNWIND
MATCH
UNWIND $data as delete MATCH (c:Car) WHERE c.model = delete.model DETACH DELETE
This is very slow. Is there a better way?
Hello @tarendran.vivekanand
You can pass for example ids you want to delete in the data, but if you want to keep your original request, you can still use apoc.periodic.iterate()
data
apoc.periodic.iterate()
CALL apoc.periodic.iterate('MATCH (c:Car) WHERE c.model IN data RETURN c', 'DETACH DELETE c', {batchSize:1000, params:{data:$data}})
Regards, Cobra
Hello @cobra Thanks for the advice but how do you determine the batchSize number of 1000. Is this arbitrary or is there some formula to this?
It depends of the power of your computer , by default I use 1000, but you can try other values between 100 and 10 000