mysql table_definition_cache_table_definition_cache和table_open_cache的区别

以下是5.5的官方定义

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 descriptors, unlike the normal table cache. The minimum and default values are both 400.

table_open_cache

The number of open tables for all threads. Increasing this value increases the number of file descriptors that mysqld requires.

前者缓存frm文件,关于后者,文档中并没有说明,想来应该是ibd/MYI/MYD;

1

为何将两者分开存放

2

线程访问一个mysql表时,需要同时打开frm和MYD/ibd吗

3

有没有方法检测这两个参数所占有的内存大小?

我刚看过taobao dba的案例,flush tables可以减少10G内存;

是不是有点夸张了

另外,微薄上看到如下案例

http://huati.weibo.com/k/%E6%AF%8F%E6%AC%A1%E6%89%93%E5%BC%80%E5%90%8E%E9%83%BD%E4%BC%9A%E5%86%8D%E8%A2%AB%E5%85%B3%E9%97%AD?from=501#!/k/%E6%AF%8F%E6%AC%A1%E6%89%93%E5%BC%80%E5%90%8E%E9%83%BD%E4%BC%9A%E5%86%8D%E8%A2%AB%E5%85%B3%E9%97%AD?from=501&order=time

#MySQL tips#之前有篇博文 http://t.cn/zWG9ikt 说到 innodb_stats_on_metadata的设置问题。今天有位同学发现一个库上面,即使把这设置为0FF,访问information_schema的那几个表仍然会导致调用索引统计。进去看后发现原因是总表数远大于table_definition_cache导致的

4

为何总表数远大于table_definition_cache就会调用索引统计信息,且在关闭innodb_stats_on_metadata的前提下?

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值