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

本站中文解释

query_cache_min_res_unit 参数指定MySQL查询缓存资源单元的最小值,其单位是字节。这一变量用于限定分配给查询缓存的资源容量。当存入查询缓存中的数据量超过了此变量设置的最小值之后,MySQL就会为查询缓存分配受此限制的资源。

可以在MySQL中设置query_cache_min_res_unit,可以使用以下命令:
SET GLOBAL query_cache_min_res_unit = integer_value;
或者
SET @@global.query_cache_min_res_unit = integer_value;
该变量可以接受任意整数值,它可以根据你的存储要求被调整。请注意,将变量设置为一个太小的值可能会使MySQL查询缓存处于空闲状态,因此查询缓存效果会受到损害(可能要大于100字节)。

官方英文解释

query_cache_min_res_unit

Command-Line Format --query-cache-min-res-unit=#
Deprecated 5.7.20
System Variable query_cache_min_res_unit
Scope Global
Dynamic Yes
Type Integer
Default Value 4096
Minimum Value 512
Maximum Value (64-bit platforms) 18446744073709551615
Maximum Value (32-bit platforms) 4294967295
Unit bytes

The minimum size (in bytes) for blocks allocated by the query
cache. The default value is 4096 (4KB). Tuning information for
this variable is given in
Section 8.10.3.3, “Query Cache Configuration”.

Note

The query cache is deprecated as of MySQL 5.7.20, and is
removed in MySQL 8.0. Deprecation includes
query_cache_min_res_unit.


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