mysql优化: waiting for.. Copying to tmp table
因为临时的结果集大于mysql中tmp_table_size设置的大小,默认是16M,mysql会将数据转存到磁盘
mysql> show variables like '%tmp%';
+-------------------+---------------+
| Variable_name | Value |
+-------------------+---------------+
| max_tmp_tables | 32 |
| slave_load_tmpdir | /pd/mysql_tmp |
| tmp_table_size | 16777216 |
| tmpdir | /pd/mysql_tmp |
+-------------------+---------------+
4 rows in set
解决方案
调整tmp_table_size
大小