Quoting this solution for efficiently updating or deleting in batches, should it be needed… (Just ran out of memory)