What is Filesort / External merge sort?
When performing sorting operations for ORDER BY, GROUP BY and there is no sufficient memory to sort all data at once, database will partition the data, sort them batch by batch and write the intermediate sorting results to disk. Since it involves heavy I/O operations, it will drastically impact query performance.
External reference