Some of my unit tests take 10-15 seconds just for mysql to create the tables. This seems unnecessarily long. It has to create around 50 tables, but that's still only 3 tables per second. This is a big annoyance when running unit tests over-and-over.
As a workaround, I have been running my unit tests in sqlite3. It is blazing fast, but I would prefer to run my tests on MySQL since that's what my live servers run.
To illustrate the speed difference, create a fresh project. Then run syncdb on it using mysql. Then try it using sqlite3.
[~/testproject] ./manage.py syncdb
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
For me, it takes about 2 seconds to create the above tables in MySQL. Sqlite3 is almost instant.
I am running mysql on my development machine. Here is my my.cnf.
Please suggest any tips or tweaks you can think of that might help speed up MySQL's table creation time.