Hello!
I have a huge performance issue when trying to rollback a big data import and calling destroy_fully! on each ActiveRecord instance with acts_as_paranoid support. Each instance has multiple soft-deletable associations with dependeng: :destroy options.
This whole process is unacceptably slow and one of the reasons (except slow AR by itself) is that destroy_fully! doesn't really destroy the resource and associations at once but at first it soft-deletes them and then makes real full deletion as a second round.
Is there any way to make this a single-round process and destroy them at once just like it would be in pure Rails?
Similarly to how we can disable touching of the associations just for a block of code:
ActiveRecord::Base.no_touching do
...
end
If it is not possible yet then maybe it can be added as a new feature?
Or might be something that will just disable acts_as_paranoid completely inside of a specified block of code?
Will it be possible to only decrease dependent cache_counters in such case if any?
Hello! I have a huge performance issue when trying to rollback a big data import and calling
destroy_fully!
on each ActiveRecord instance with acts_as_paranoid support. Each instance has multiple soft-deletable associations withdependeng: :destroy
options. This whole process is unacceptably slow and one of the reasons (except slow AR by itself) is thatdestroy_fully!
doesn't really destroy the resource and associations at once but at first it soft-deletes them and then makes real full deletion as a second round. Is there any way to make this a single-round process and destroy them at once just like it would be in pure Rails?Similarly to how we can disable touching of the associations just for a block of code:
If it is not possible yet then maybe it can be added as a new feature? Or might be something that will just disable acts_as_paranoid completely inside of a specified block of code? Will it be possible to only decrease dependent cache_counters in such case if any?
Thanks!