In MySQL 5.5 and earlier, a derived table never had indexes. The only way a derived table would be accessed was by a full scan. (That's the ALL
you see in the EXPLAIN output from the 5.5 server.)
With MySQL 5.6.3, MySQL has the ability to add an index to a derived table, which can improve performance. (Note the name of the index: <auto_key1>
in the EXPLAIN output from the 5.6 server).
Reference: https://dev.mysql.com/doc/refman/5.6/en/subquery-optimization.html