MySQL Variables metadata_locks_cache_size 数据库 参数变量解释及正确配置使用

本站中文解释

metadata_locks_cache_size参数变量用于控制MySQL Metropolitan Data Locking(元数据锁定)系统的缓存大小,以便服务器在正确检测元数据的上锁和解锁活动时有一个更大的选择范围。

MySQL元数据锁定系统本质上是一种隐式锁定机制,它允许线程在表示它们正在处理的数据库元素(如表,索引等)上设置可实时查询的锁。

metadata_locks_cache_size参数默认值为1024,它可以在MySQL配置文件my.cnf中设置:

[Mysqld]
metadata_locks_cache_size = 2048

官方英文解释

metadata_locks_cache_size

Command-Line Format --metadata-locks-cache-size=#
Deprecated Yes
System Variable metadata_locks_cache_size
Scope Global
Dynamic No
Type Integer
Default Value 1024
Minimum Value 1
Maximum Value 1048576
Unit bytes

The size of the metadata locks cache. The server uses this
cache to avoid creation and destruction of synchronization
objects. This is particularly helpful on systems where such
operations are expensive, such as Windows XP.

In MySQL 5.7.4, metadata locking implementation changes make
this variable unnecessary, and so it is deprecated; expect it
to be removed in a future release of MySQL.


数据运维技术 » MySQL Variables metadata_locks_cache_size 数据库 参数变量解释及正确配置使用