Mysql implementation plan, other than a good understanding of columns, except the Extra column, people always see a little half-comprehended, before finally found a chance to study under his.
Chinese name is called the index covers the query: if the query time, use the index, and the data you need is the final part of this index, then there using index.
user table has an index key (id), key (name)
select id from user;
select name from user;
select id from user where id <9;
The select id, name from user where id <9 no
Composite index key (id, name)
select id, name from user where id> 9 can have
Based on the query to filter the result set
using file sort and using temporary:
These two are the most likely confusing, many people are likely to extend the meaning of the expression will understand, in fact, the content of his expression is very limited.
using file sort: that sort of time, no access to the index, had to take other sort of way. Here are other ways in memory row, row in a temporary file, using the dual sort, or use the entire line sorting, and using file sort and did not say what sort of other methods.
using temporary: that uses a temporary table, as this temporary table in memory or on disk which are unknown.
Emergence of this situation is very much a two-step, here only a few columns it:
using file sort:
order by the first column is not the first implementation plan in the index on the table
order by multiple columns, not in the same index on the table
order by the column, there are ascending, descending, inconsistent
In the group by time, if, by group by column is not indexed, then you need a temporary table for group, the other without order by null, may have to file sort order.
In order by time, if the sort column, distributed in excess on a table