mysql临时表的大小的参数_Mysql参数详解__ 临时表

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%)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值