如何在MySql中检查数据字典大小 [英] How to check Data Dictionary size in MySql

查看:206
本文介绍了如何在MySql中检查数据字典大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查我当前的数据字典缓存大小?

How to check my current data dictionary cache size?

仅供参考: ->数据字典缓存-存储打开的表信息.因此,数据字典缓存的增加取决于打开表的数量.

FYI: -> Data Dictionary cache - which stores open tables information. So that the data dictionary cache increases depends upon the number of open tables.

-> table_open_cache是​​一个变量,它保存一个值,即mysql可以具有打开表的总数.我问有打开表数据的当前数据字典大小. (当前数据字典大小的状态).

-> table_open_cache is an variable which holds a value that mysql can have total number of open tables. Im asking the current data dictionary size which has the data of open tables. (Status of current data dictionary size).

MySql版本-5.7.18

MySql version - 5.7.18

推荐答案

这些变量可能是相关的:

These VARIABLES may be relevant:

table_open_cache
table_open_cache_instances
table_definition_cache
schema_definition_cache  (new in 8.0)
tablespace_definition_cache  (new in 8.0)

每个缓存是固定大小的,可以在启动时配置. (在某些情况下,在较新版本上,可以动态更改.)

Each cache is a fixed size, configurable at startup time. (In some cases, on newer versions, it can be dynamically changed.) The docs for 5.7 say, for example, that table_open_cache is "Dynamic"

这些GLOBAL STATUS值可能是相关的:

These GLOBAL STATUS values may be relevant:

Open_table_definitions
Opened_table_definitions
Opened_tables
Opened_files
Table_open_cache_hits
Table_open_cache_misses
Table_open_cache_overflows

点击/丢失/溢出为您提供了很好的线索,说明table_open_cache是否足够大,但不是最佳大小.

The hits/misses/overflows give you good clues as to whether the table_open_cache is big enough, but not what the optimal size is.

在5.7及更低版本中,数据字典来自分散在磁盘上的.frm文件.在8.0中,它位于一组InnoDB表中.据推测,一个合适的查询可以提供一些相关指标.

In 5.7 and before, the data dictionary comes from the .frm files scattered on disk. In 8.0, it is in a set of InnoDB tables. Presumably, a suitable query could provide some relevant metrics.

另请参见 performance_schema_max_table_handles .

这篇关于如何在MySql中检查数据字典大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆