[LRUG] Request for assistance with Rails performance oddity

John Winters john at sinodun.org.uk
Sun Oct 31 01:58:22 PDT 2010


On Sat, 30 Oct 2010 17:35:01 +0100, Andrew Stewart
<boss at airbladesoftware.com> wrote:
[snip]
> If you use #delete_all then ActiveRecord will issue a SQL call without
> loading the individual records into memory.  If you use #destroy_all,
> ActiveRecord loads each one in turn into memory so it can fire
> before/after_destroy callbacks and cascade to associations.

I do need to do a destroy, because I need to delete the subsidiary records
too.  I can't use destroy_all because I want to destroy records only in a
specified range.

John



More information about the Chat mailing list