Ask for Help
“I have a dependent destroy that is taking 5sec+, What can I do to speed that up?”
- try dependent delete on the leaves of the chain if you don’t have any after destroy hooks there that need running.
- try cascade delete in your database (again as long as you don’t have any after destroys to worry about)
- try marking the element at the top of the tree as deleted (using acts as paranoid or similar), then run an offline process to look for those records and destroy them and their dependent objects.
- don’t worry about orphaned records and manually clean them up every once in a while (unrecommended but least development effort)