Want a Slow Website? Use InnoDB

I have many web-apps running online, and most are supported by a MySQL backend, with tables using the InnoDB engine.

InnoDB is great, it enforces data-integrity with foreign keys, not like MyISAM that doesn't give a damn.

Want a Slow Website?  Use InnoDB

When I recently benchmarked a particular web-app, I noticed one update query taking approximately 0.45 seconds.  This was simply to update the user table to set the last-login field.

UPDATE user SET last_login = ? WHERE ( id = ? ) : '2015-06-01 17:57:03', '2'
Took: 0.456952 seconds

The user table has less than 200 rows, and 5 columns.

It did however have 11 foreign keys linking to it, so I quickly dropped those, and finally converted the table to MyISAM.

mysql> alter table user engine=myisam;

Which reduced timings ever so slightly!

UPDATE user SET last_login = ? WHERE ( id = ? ) : '2015-06-01 19:24:16', '2'
Took: 0.000180 seconds

I'm using DBIx::Class in Perl when dealing with the database, so relationships are configured to deal with cascading of deletes in the app, saving the database engine the job.

For high-performance web-apps InnoDB doesn't appear to be the best idea in the world.

Leave Comment
Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!