mysql5.7 table cache_MySQL关于Table cache设置,看这一篇就够了

本文详细解析了MySQL的table_definition_cache、table_open_cache和table_open_cache_instances参数,包括它们的作用、限制及如何优化。了解这些参数有助于提升MySQL数据库的性能和并发能力,避免Opening tables、Closing tables状态导致的应用延迟问题。建议根据实际环境和需求设置相关参数,以确保在高负载下仍能有效管理表缓存。
摘要由CSDN通过智能技术生成

原标题:MySQL关于Table cache设置,看这一篇就够了

导读:本文整理对table_definition_cache,table_open_cache和table_open_cache_instances这几种参数的理解,希望对大家有帮助。

先看看官网怎么说:

1. table_definition_cache

the number of table definitions (from .frm files) that can be stored in the definition cache. If you use a large number of tables, you can create a large table definition cache to speed up opening of tables. The table definition cache takes less space and does not use file deors, unlike the normal table cache.

理解下来,就是控制总frm文件的数量,还是个hash表,内部维护。如果打开的表实例的数量超过了table_definition_cache设置,LRU机制将开始标记表实例以进行清除,并最终将它们从数据字典缓存中删除。

简单通俗点frm文件有多少,就设置多少了。

2. table_open_cache

The number of open tables for all threads. Increasing this value increases the number of file deors that mysqld requires. You can check whether you need to increase the table cache by checkin

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值