Abnormally low performance on INSERTS?

Sture Eklund <[email protected]> Thu, 20 Oct 2005 08:37:43 +0200
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Hi all

 

We are conducting a database test here in Skellefteå, comparing MySQL,
Access and Postgre in a lab assignment.

The problem we have with MySQL  database is that INSERT-performance is
abnormally slow on some computers and as fast as expected on others. For
instance, if I run the test application on my computer at home the complete
test sequence would take about 6 minutes. It includes ~250 000 INSERTS, so
no extreme amount. If I would run the same test with my laptop, I estimate
the time it would take to about 2½ hours... and the performance hit is more
or less completely related to INSERTS.

 

The problem is replicated on numerous computers and all of them are using
standard settings and InnoDB. But the same settings are used on those
computers were it works as expected... and if it was a bug related to InnoDB
with maybe 50% of all computers affected, why isn't it documented with a
solution?

 

To simplify it, you can say that the performance delta on INSERTs are 1:23
between two reasonably equal computers. Other databases (Access and Postgre)
might have a delta of 1:1.2 or something similar at worst.

 

WinXP OS with SP2, DOT.NET and tested with both C# and C++, both MySQL 4.x
and 5.0.12. MyODBC 3.51.

 

INSERTs are being conducted in three different tables, no huge data sizes
and the tables are being mixed while inserting data.

If changing engine to MyISAM would be an option, the problem would be
solved… performance is then  as expected. But since MyISAM lacks too much
features, it would be to compare apples with bananas.

 

We would appreciate any tips regarding this matter, if you have any
questions regarding our MySQL settings you can simply check the defaults… no
tweaks or anything, shouldn’t be necessary for this kind of test.

 

Regards Sture Eklund