Very slow JOIN + ORDER BY query only in dev environment
I noticed in mysql_error.log hundreds of entries like this:

[Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name 
table_name. Please run mysql_upgrade


I ran this:

/Applications/MAMP/Library/bin/mysql_upgrade --host=localhost -uroot -proot


The problem now seems to be resolved – the initial query above is now taking about 20ms.

Perhaps it was corrupted on installation?