您的位置:首页 > 职场人生

Converting HEAP to MyISAM in SHOW PROCESSLIST

2011-08-03 12:24 1246 查看
http://www.mysqlab.net/knowledge/kb/detail/topic/myisam/id/6149

Discussion

The state "converting HEAP to MyISAM" happens when a query that needs a temporary table is converting from an in-memory temporary table to a disk-based temporary table.

MySQL uses memory-based temporary tables up to the size limit set by the tmp_table_size system variable. If a query needs a temporary table larger than this it will be converted to a disk-based temporary table using the MyISAM storage engine.

GROUP BY queries and ORDER BY queries that can't use an index for the ordering are the most common causes of temporary table creation.

Solution

You could consider raising the per-session value of tmp_table_size if you have sufficient memory. Use the SHOW GLOBAL STATUS statement to see the value of the Created_tmp_tables variable. It will show the total number of temporary tables that have been created:

SHOW GLOBAL STATUS LIKE 'Created_tmp_tables';

+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| Created_tmp_tables | 13    |
+--------------------+-------+

The

Created_tmp_disk_tables

variable shows how many of those have been converted to disk temporary tables:

SHOW GLOBAL STATUS LIKE 'Created_tmp_disk_tables';

+-------------------------+-------+
| Variable_name           | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 1     |
+-------------------------+-------+


调2个参数

tmp_table_size和max_heap_table_size ============> converting HEAP to MyISAM
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  职场 休闲 HEAP