一起学习网 一起学习网


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

网络编程 MySQL Variables read_buffer_size 数据库 参数变量解释及正确配置使用 10-15

本站中文解释

read_buffer_size参数用于控制每次从MySQL服务器读取数据时使用的缓冲区大小,单位为字节,默认值为 1MB。因此,如果要设置read_buffer_size参数,则需要在MySQL服务器上编辑my.cnf文件,在[mysqld]节点下添加以下行:

read_buffer_size=n

其中,n为指定的参数值(单位为字节)。

在修改参数后,需要重新启动MySQL服务器才能生效。

官方英文解释

read_buffer_size

Command-Line Format--read-buffer-size=#
System Variableread_buffer_size
ScopeGlobal, Session
DynamicYes
TypeInteger
Default Value131072
Minimum Value8192
Maximum Value2147479552
Unitbytes
Block Size4096

Each thread that does a sequential scan for a
MyISAM table allocates a buffer of this
size (in bytes) for each table it scans. If you do many
sequential scans, you might want to increase this value, which
defaults to 131072. The value of this variable should be a
multiple of 4KB. If it is set to a value that is not a
multiple of 4KB, its value is rounded down to the nearest
multiple of 4KB.

This option is also used in the following context for all
storage engines:

  • For caching the indexes in a temporary file (not a
    temporary table), when sorting rows for ORDER
    BY
    .

  • For bulk insert into partitions.

  • For caching results of nested queries.

read_buffer_size is also used
in one other storage engine-specific way: to determine the
memory block size for MEMORY
tables.

For more information about memory use during different
operations, see Section 8.12.4.1, “How MySQL Uses Memory”.


编辑:一起学习网

标签:参数,字节,单位,服务器,要在