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

本站中文解释

max_join_size参数用于最大限度地限制联接中能够出现的记录数量。如果你想让MySQL不要在查询联及了很多表,希望MySQL只返回少量的结果,可以通过设置max_join_size参数来去限制。

要修改MySQL参数变量max_join_size的值,可以通过在MySQL命令行中,使用SET命令来修改:

SET max_join_size = ;

其中根据实际情况进行修改,最大可以设置为18446744073709551615。

官方英文解释

max_join_size

Command-Line Format --max-join-size=#
System Variable max_join_size
Scope Global, Session
Dynamic Yes
Type Integer
Default Value 18446744073709551615
Minimum Value 1
Maximum Value 18446744073709551615

Do not permit statements that probably need to examine more
than max_join_size rows (for
single-table statements) or row combinations (for
multiple-table statements) or that are likely to do more than
max_join_size disk seeks. By
setting this value, you can catch statements where keys are
not used properly and that would probably take a long time.
Set it if your users tend to perform joins that lack a
WHERE clause, that take a long time, or
that return millions of rows. For more information, see
Using Safe-Updates Mode (–safe-updates).

Setting this variable to a value other than
DEFAULT resets the value of
sql_big_selects to
0. If you set the
sql_big_selects value again,
the max_join_size variable is
ignored.

If a query result is in the query cache, no result size check
is performed, because the result has previously been computed
and it does not burden the server to send it to the client.


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