Forum: Ruby on Rails mysql performance

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
05c3f39db309047f28628a223a757bec?d=identicon&s=25 Hans Marmolin (marmolin)
on 2009-03-23 18:45
(Received via mailing list)
Rails mysql performance

I have an application that reads an xml file, parse it and from there
updates the database. My models has many associations and there are a
lot of creation of new records  in the database. The performance is
slow and my analyses shows that  mysql is to blame.

In a separate test it took about 11 seconds to create 100 records, i.e
0.1 sec for each record.
Is that normal for the development mode?

I develop on a new mac leopard with rails 2.2.2, ruby 1.8.6 and mysql
Ver 14.12 Distrib 5.0.51a, for apple-darwin9.0.0b5 (i686) using
readline 5.0.

Any suggestions woul be appreciated
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-03-23 19:06
(Received via mailing list)
On 23 Mar 2009, at 17:44, Hans wrote:

> Is that normal for the development mode?
If it's inside a single action development mode isn't going to be
slower once it's reloaded your models' code and so on.
Have you tried wrapping the insert inside a transaction ? If you don't
then mysql has to flush to disk after each insert which can slow you
down considerably.

Fred
This topic is locked and can not be replied to.