It is bit panic to see ‘Using filesort‘ from the extra field when one runs a explain of select query on MySQL server. At times it is bit annoy why MySQL optimizer does not avoid this as you can see from the following cases…
This is the information (Extra field) that scares a lot for many users from Explain output:
| [Copy to clipboard][-]View Code | |
1 2 3 4 5 6 7 8 9 10 |
id: 1
select_type: SIMPLE
table: t1
type: index
possible_keys: NULL
key: col1key
key_len: 5
ref: NULL
rows: 1000000
Extra: USING index; USING temporary; USING filesort |
Lets consider the following simple …
[Read more]