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

本站中文解释

MySQL 数据库管理系统中常用到的参数变量 myisam_max_sort_file_size(MyISAM 最大排序文件大小),用于指定一个 MyISAM 索引排序操作中可打开的最大文件大小,单位为字节。如果任务所需的排序文件比这个参数指定的值大,MySQL将会使用内存缓冲区来排序,这样可能会降低性能。

要设置MySQL参数变量 myisam_max_sort_file_size,首先以管理员身份登录MySQL,然后输入以下命令:

set global myisam_max_sort_file_size = value;

其中 value 可以根据实际情况设置为合理的值,推荐设置为2~4MB。

官方英文解释

myisam_max_sort_file_size

Command-Line Format --myisam-max-sort-file-size=#
System Variable myisam_max_sort_file_size
Scope Global
Dynamic Yes
Type Integer
Default Value (Windows) 2146435072
Default Value (Other, 64-bit platforms) 9223372036853727232
Default Value (Other, 32-bit platforms) 2147483648
Minimum Value 0
Maximum Value (Windows) 2146435072
Maximum Value (Other, 64-bit platforms) 9223372036853727232
Maximum Value (Other, 32-bit platforms) 2147483648
Unit bytes

The maximum size of the temporary file that MySQL is permitted
to use while re-creating a MyISAM index
(during REPAIR TABLE,
ALTER TABLE, or
LOAD DATA). If the file size
would be larger than this value, the index is created using
the key cache instead, which is slower. The value is given in
bytes.

If MyISAM index files exceed this size and
disk space is available, increasing the value may help
performance. The space must be available in the file system
containing the directory where the original index file is
located.


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