Created_tmp_disk_tables:
在执行查询的时候,建立在磁盘上的临时表的数据量,平时临时表是建立在内存中的,但是如果临时表过大则在磁盘中建立,
大家都知道磁盘的读写是要比内存慢的,所以尽量避免在磁盘中进行临时表的读写。可以通过 tmp_table_size 和 max_heap_table_size参数
来设置内存中临时表的大小
Created_tmp_files:
建立临时文件的数量
Created_tmp_tables:
建立的临时表的数量。
mysql> show status like 'created_tmp%';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| Created_tmp_disk_tables | 0 |
| Created_tmp_files | 2850 |
| Created_tmp_tables | 2 |
+-------------------------+-------+
这个说明:现在Mysql的临时表都在内存中。
mysql> show global status like 'created_tmp%';
+-------------------------+---------+
| Variable_name | Value |
+-------------------------+---------+
| Created_tmp_disk_tables | 4184337 |
| Created_tmp_files | 4124 |
| Created_tmp_tables | 4215028 |
+-------------------------+---------+
这个说明:Mysql有大量的临时表建立在磁盘上,需要增加tmp_table_size的值。仅供参考:Created_tmp_disk_tables / Created_tmp_tables * 100% = 99% (理想值<= 25%)