How can I write queries as fast as possible in MySQL? I'm looking for two things:


Awesome manual about writing fast MySQL queries.
Tool which will decompose my query into discrete steps, and give estimations of each step. 


I've seen the next tool, but I don't know how to use it.
I have used HeidiSQL for a while and it have very useful profiling feature that allow to get detailed profile of query execution. Also EXPLAIN is the first tool you have to learn.

Less obvious is that you have to place your databases on the filesystem with noatime option. Each time some software read/write from/to the disk, another implicit write(s) performed - to update "last access time" for accessed files. When noatime active that time is not updated and overall iops is halved.