MySQL slow select on information_schema

I noticed that selects on the information_schema table was very slow. Found this guide on how to fix it

http://www.percona.com/blog/2011/12/23/solving-information_schema-slowness/

So the magic that fixed it was

set global innodb_stats_on_metadata=0;

That improved my SQL query from taking 15 seconds down to 0.03 seconds.