Those operations of mysql may generate temporary tables on disk

1. UNION query;
2. Use the TEMPTABLE algorithm or the view in the UNION query;
3. When the clauses of ORDER BY and GROUP BY are not the same or group by separately;
4. In the table connection, the ORDER BY column is not the driving table In; (when the connection condition is specified, the table with fewer rows that meets the query condition is [drive table], when the connection condition is not specified, the table with fewer rows is [drive table], and when multiple tables are in a joint query)
5 , DISTINCT query and add ORDER BY or separate distinct time;
6. When SQL_SMALL_RESULT option is used in SQL;
7. Subquery in FROM;
8. Table created during subquery or semi-join;

Guess you like

Origin blog.csdn.net/qq_42000661/article/details/108725527