Skip to main content

Temporary Tables & Filesort in Plans

Learn Temporary Tables & Filesort in Plans (Query Optimization, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Introduction In EXPLAIN's Extra column, Using temporary means MySQL builds an internal temporary table (for GROUP BY, DISTINCT, UNION, derived tables). Using filesort means it sorts rows itself instead of reading them in index order; despite the name it may be done fully in memory.

More lessons in Query Optimization