A brief introduction: the relevant manufacturers to talk about skyrocketing temporary table file
Two analysis:
1 mysql5.7 can already be provided a separate temporary table directory, the default directory is placed in the data file name ibtmp1
2 ibtmp1 file disk usage can not be released unless restart the instance
Three impact statements
Table 1 shows the creation of temporary
2 DDL operation changes the copy mode column, etc., need to copy the data into the temporary table
3 select the type of query is applied to the temporary table
Note 1 select query will first apply the amount tmp_table_szie (memory allocation), and when the amount of temporary storage exceeds the parameter limits that will apply for space in the ibtmp1
2 select union all statements has been optimized, will not use the temporary table space
3 possible types
When 1 select order by group by GROUP BY no index fields or GROUP BY + ORDER BY clause is not the same field
2 select (select) subqueries
3 insert into select ... from ... copy table data
4 select union select joint statement
Four summary
If your disk is small, it must be noted ibtmp1 file size, optimize slow queries, reduce copy large tables