字典对象缓存是一个共享全局缓存,用于将先前访问过的数据字典对象存储在内存中,以实现对象重用并最小化磁盘 I/O。类似于 MySQL 使用的其他缓存机制,字典对象缓存使用基于 LRU 的逐出策略,从内存中逐出最近最少使用的对象。The dictionary object cache is a shared global cache that stores previously accessed data dictionary objects in memory to enable object reuse and minimize disk I/O. Similar to other cache mechanisms used by MySQL, the dictionary object cache uses an LRU-based eviction strategy to evict least recently used objects from memory.
字典对象缓存由存储不同对象类型的缓存分区组成。某些缓存分区大小限制可以配置,而其他一些则是硬编码的。The dictionary object cache comprises cache partitions that store different object types. Some cache partition size limits are configurable, whereas others are hardcoded.
表空间定义缓存分区:存储表空间定义对象。
tablespace_definition_cache选项设置可以存储在字典对象缓存中的表空间定义对象数量的限制。默认值为 256。tablespace definition cache partition: Stores tablespace definition objects. Thetablespace_definition_cacheoption sets a limit for the number of tablespace definition objects that can be stored in the dictionary object cache. The default value is 256.模式定义缓存分区:存储模式定义对象。
schema_definition_cache选项设置可以存储在字典对象缓存中的模式定义对象数量的限制。默认值为 256。schema definition cache partition: Stores schema definition objects. Theschema_definition_cacheoption sets a limit for the number of schema definition objects that can be stored in the dictionary object cache. The default value is 256.表定义缓存分区:存储表定义对象。对象数量限制设置为
max_connections的值,默认值为 151。table definition cache partition: Stores table definition objects. The object limit is set to the value ofmax_connections, which has a default value of 151.表定义缓存分区与使用
table_definition_cache配置选项配置的表定义缓存并行存在。两个缓存都存储表定义,但服务于 MySQL 服务器的不同部分。一个缓存中的对象与另一个缓存中的对象的存在无依赖关系。The table definition cache partition exists in parallel with the table definition cache that is configured using thetable_definition_cacheconfiguration option. Both caches store table definitions but serve different parts of the MySQL server. Objects in one cache have no dependence on the existence of objects in the other.存储程序定义缓存分区:存储存储程序定义对象。
stored_program_definition_cache选项设置可以存储在字典对象缓存中的存储程序定义对象数量的上限。默认值为 256。stored program definition cache partition: Stores stored program definition objects. Thestored_program_definition_cacheoption sets a limit for the number of stored program definition objects that can be stored in the dictionary object cache. The default value is 256.存储程序定义缓存分区与使用
stored_program_cache选项配置的存储过程缓存和存储函数缓存并行存在。The stored program definition cache partition exists in parallel with the stored procedure and stored function caches that are configured using thestored_program_cacheoption.stored_program_cache选项为每个连接缓存的存储过程或函数的数量设置一个软上限,并且每次连接执行存储过程或函数时都会检查该限制。而存储程序定义缓存分区则是一个共享缓存,用于存储其他用途的存储程序定义对象。存储程序定义缓存分区中对象的存在与存储过程缓存或存储函数缓存中对象的存在相互独立,反之亦然。Thestored_program_cacheoption sets a soft upper limit for the number of cached stored procedures or functions per connection, and the limit is checked each time a connection executes a stored procedure or function. The stored program definition cache partition, on the other hand, is a shared cache that stores stored program definition objects for other purposes. The existence of objects in the stored program definition cache partition has no dependence on the existence of objects in the stored procedure cache or stored function cache, and vice versa.字符集定义缓存分区:存储字符集定义对象,并且其对象数量限制为硬编码的 256。character set definition cache partition: Stores character set definition objects and has a hardcoded object limit of 256.
排序定义缓存分区:存储排序定义对象,并且有硬编码的对象限制为 256。collation definition cache partition: Stores collation definition objects and has a hardcoded object limit of 256.
有关字典对象缓存配置选项的有效值的信息,请参阅 第 7.1.8 节,“服务器系统变量”。For information about valid values for dictionary object cache configuration options, refer to Section 7.1.8, “Server System Variables”.