I have a relationship between two models, one of them has a "has_many" relation and the other one has a "belongs_to" relation. So, when I run a delete on the model with "has_many" relation all of his children are softdeleted. I'd like to know if the children are deleted one by one or is it created a query that deletes all children in one single action like 'Delete from'.
The "has_many" relation has a bunch of children and deleting one by one can take a long time to execute.
I wonder if there is a way to delete all children without being one by one.
In general the ORM operates on objects, the relation is not aware of other objects, so optimisations in this area is going to be complex.
Having said that, I've never used Model_Soft myself, but I understand it sets a timestamp to mark the record as soft-deleted, so nothing prevents you from creating a query that does that directly.
If you do, note that ORM objects are cached, so changes to the database this way will not be reflected in the cached object.