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

本站中文解释

read_buffer_size:设置MySQL查询缓存大小,最小值是 1K,最大值是 134217728 (128MB)。当请求结果集超过查询缓存,MySQL会放弃使用缓存。

max_digest_length:一个MySQL请求文本存储的解析结果中的最大字节数,默认为 1024 字节。它能够跟踪数据的改变,当改变超出这个值将被忽略,并在统计信息中被标记为 [truncated] 。

设置 max_digest_length 参数的方法如下:

1. 登录MySQL的客户端,如mysql
2. 确认当前参数的值:
> SHOW VARIABLES LIKE ‘max_digest_length’;
3. 设置参数:
> SET GLOBAL max_digest_length=4096;
4. 检查参数是否被设置:
> SHOW VARIABLES LIKE ‘max_digest_length’;

官方英文解释

max_digest_length

Command-Line Format --max-digest-length=#
System Variable max_digest_length
Scope Global
Dynamic No
Type Integer
Default Value 1024
Minimum Value 0
Maximum Value 1048576
Unit bytes

The maximum number of bytes of memory reserved per session for
computation of normalized statement digests. Once that amount
of space is used during digest computation, truncation occurs:
no further tokens from a parsed statement are collected or
figure into its digest value. Statements that differ only
after that many bytes of parsed tokens produce the same
normalized statement digest and are considered identical if
compared or if aggregated for digest statistics.

Warning

Setting max_digest_length
to zero disables digest production, which also disables
server functionality that requires digests, such as MySQL Enterprise Firewall.

Decreasing the
max_digest_length value
reduces memory use but causes the digest value of more
statements to become indistinguishable if they differ only at
the end. Increasing the value permits longer statements to be
distinguished but increases memory use, particularly for
workloads that involve large numbers of simultaneous sessions
(the server allocates
max_digest_length bytes per
session).

The parser uses this system variable as a limit on the maximum
length of normalized statement digests that it computes. The
Performance Schema, if it tracks statement digests, makes a
copy of the digest value, using the
performance_schema_max_digest_length.
system variable as a limit on the maximum length of digests
that it stores. Consequently, if
performance_schema_max_digest_length
is less than
max_digest_length, digest
values stored in the Performance Schema are truncated relative
to the original digest values.

For more information about statement digesting, see
Section 25.10, “Performance Schema Statement Digests”.


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