文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 83%

29.12.14 Performance Schema 系统变量表29.12.14 Performance Schema System Variable Tables

MySQL 服务器维护着许多系统变量,这些变量指示其配置情况(参见 第 7.1.8 节,“服务器系统变量”)。这些性能模式表中提供了系统变量信息:The MySQL server maintains many system variables that indicate how it is configured (see Section 7.1.8, “Server System Variables”). System variable information is available in these Performance Schema tables:

查看这些表中敏感系统变量的值需要 SENSITIVE_VARIABLES_OBSERVER 权限。The SENSITIVE_VARIABLES_OBSERVER privilege is required to view the values of sensitive system variables in these tables.

会话变量表(session_variables,variables_by_thread)仅包含活动会话的信息,不包括已终止的会话。The session variable tables (session_variables, variables_by_thread) contain information only for active sessions, not terminated sessions.

global_variables 和 session_variables 表具有以下列:The global_variables and session_variables tables have these columns:

  • VARIABLE_NAME

    系统变量名称。The system variable name.

  • VARIABLE_VALUE

    系统变量值。对于 global_variables,此列包含全局值。对于 session_variables,此列包含当前会话生效的变量值。The system variable value. For global_variables, this column contains the global value. For session_variables, this column contains the variable value in effect for the current session.

global_variables 和 session_variables 表具有以下索引:The global_variables and session_variables tables have these indexes:

  • 主键在 (VARIABLE_NAME) 上Primary key on (VARIABLE_NAME)

variables_by_thread 表具有以下列:The variables_by_thread table has these columns:

  • THREAD_ID

    定义系统变量的会话的线程标识符。The thread identifier of the session in which the system variable is defined.

  • VARIABLE_NAME

    系统变量名称。The system variable name.

  • VARIABLE_VALUE

    由 THREAD_ID 列命名的会话的会话变量值。The session variable value for the session named by the THREAD_ID column.

variables_by_thread 表具有以下索引:The variables_by_thread table has these indexes:

  • 主键在 (THREAD_ID, VARIABLE_NAME) 上Primary key on (THREAD_ID, VARIABLE_NAME)

variables_by_thread 表仅包含关于前台线程的系统变量信息。如果性能模式未对所有线程进行监控,则该表会缺少一些行。在这种情况下,Performance_schema_thread_instances_lost 状态变量大于零。The variables_by_thread table contains system variable information only about foreground threads. If not all threads are instrumented by the Performance Schema, this table misses some rows. In this case, the Performance_schema_thread_instances_lost status variable is greater than zero.

TRUNCATE TABLE 不支持性能模式系统变量表。TRUNCATE TABLE is not supported for Performance Schema system variable tables.