On Wed, Nov 18, 2009 at 11:17 AM, helzer <[email protected]> wrote:
> Table.find(:all).each { |e| e.save }
>
>
After thinking about what you're trying to do, it might be much faster to
simply
perform the update using SQL. Then you'll avoid AR all together.
Otherwise,
you might be interested in using something ar-extensions which is great for
bulk updates.
-Conrad
> I have some processing per entry, but even if I remove it all and just
> do the save, it takes forever.
>
> If I return everything else and just comment out e.save it completes
> quickly.
>
> What puzzles me is that the CPU is running 100%, 95% Ruby and only 5%
> MySQL, so the actual table updates are not the problem. Active Record
> is just loading it.
>
> Amir
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.