MySQL Variables range_alloc_block_size 数据库 参数变量解释及正确配置使用
本站中文解释
range_alloc_block_size参数用于控制当MySQL使用内存分配器时分配内存块的大小。如果该参数设置为较大值,则MySQL会在分配内存时使用更多的内存块,这可以提升分配内存的效率。
range_alloc_block_size参数的取值范围为1KB到2GB,建议将其设置为256 KB或更大的值。设置该参数的命令格式如下:
可以在my.cnf文件中设置
range_alloc_block_size=256K或者更高
也可以运行在控制台中设置
SET GLOBAL range_alloc_block_size = 256K;
官方英文解释
range_alloc_block_size
Command-Line Format | --range-alloc-block-size=# |
---|---|
System Variable | range_alloc_block_size |
Scope | Global, Session |
Dynamic | Yes |
Type | Integer |
Default Value | 4096 |
Minimum Value | 4096 |
Maximum Value (64-bit platforms) | 18446744073709550592 |
Maximum Value | 4294966272 |
Unit | bytes |
Block Size | 1024 |
The size in bytes of blocks that are allocated when doing
range optimization.
The block size for the byte number is 1024. A value that is
not an exact multiple of the block size is rounded down to the
next lower multiple of the block size by MySQL Server before
storing the value for the system variable. The parser allows
values up to the maximum unsigned integer value for the
platform (4294967295 or 232−1
for a 32-bit system, 18446744073709551615 or
264−1 for a 64-bit system)
but the actual maximum is a block size lower.