我最近开始注意到我的MySQL的大量tmp表正在我的磁盘上而不是在内存中创build。
TEMP TABLES Current max_heap_table_size = 128 M Current tmp_table_size = 128 M Of 73993 temp tables, 46% were created on disk Perhaps you should increase your tmp_table_size and/or max_heap_table_size to reduce the number of disk-based temporary tables Note! BLOB and TEXT columns are not allow in memory tables. If you are using these columns raising these values might not impact your ratio of on disk temp tables.
我怎么能优化这个,所以它使用内存,而不是磁盘,因为它会更快。
你打印的文字告诉你你需要做什么:
Perhaps you should increase your tmp_table_size and/or max_heap_table_size to reduce the number of disk-based temporary tables
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_tmp_table_size http://dev.mysql.com/doc/refman/5.0/en/server-system-variables的.html#sysvar_max_heap_table_size