平台:
OS:CentOS6.2
DB Version:MySQL 5.5.24
现象:
页面查询缓慢
处理过程:
show processlist;
非常多语句SQL State:Copying to tmp table
查询tmp_table_size 为默认16M
mysql> show variables like '%tmp%';
+-------------------+----------+
| Variable_name | Value |
+-------------------+----------+
| max_tmp_tables | 32 |
| slave_load_tmpdir | /tmp |
| tmp_table_size | 16777216 |
| tmpdir | /tmp |
+-------------------+----------+
4 rows in set (0.00 sec)
/etc/my.cnf添加
tmp_table_size = 256M