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

本站中文解释

big_tables是MySQL在处理超大表(大于2GB)时出现的特殊参数变量,这个变量表示是否处理非常大的表。

如果我们需要处理超大表,MySQL会自动调整big_tables参数变量的值以使用正确的算法来处理超大表。

要设置big_tables,可以在MySQL的配置文件(my.cnf)中添加以下行:

[mysqld]
big_tables=1

如果将big_tables参数设为1,MySQL会自动使用正确的算法来处理超大表;如果将其设为0,将禁用此功能(此时MySQL将不会处理超大表)。

官方英文解释

big_tables

Command-Line Format --big-tables[={OFF|ON}]
System Variable big_tables
Scope Global, Session
Dynamic Yes
Type Boolean
Default Value OFF

If enabled, the server stores all temporary tables on disk
rather than in memory. This prevents most The table
tbl_name is full
errors
for SELECT operations that
require a large temporary table, but also slows down queries
for which in-memory tables would suffice.

The default value for new connections is
OFF (use in-memory temporary tables).
Normally, it should never be necessary to enable this variable
because the server is able to handle large result sets
automatically by using memory for small temporary tables and
switching to disk-based tables as required.


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