根据 open_tables 设置 table_cache

根据 open_tables 设置 table_cache

我的 MySQL 服务器非常繁忙。它打开了 750k 个表。我读到过应该根据 closed_tables 增加 table_cache,但我不知道该如何扩展它?如果我将 table_cache 设置为 750k,会发生什么?

答案1

我认为您运行了很多查询,生成了很多临时表。从文档页面中的评论来看表缓存,似乎每个临时表都会将计数器增加 2。我认为扩展 table_cache 变量不是问题所在。

如果您明确创建临时表,除了调整代码之外,没有什么可以做的。

以下是有关临时表的更多有用信息:http://dev.mysql.com/doc/refman/5.5/en/internal-temporary-tables.html

相关内容