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

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

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

28.3.24 INFORMATION_SCHEMA PROFILING 表28.3.24 The INFORMATION_SCHEMA PROFILING Table

PROFILING 表提供语句分析信息。其内容与 SHOW PROFILE 和 SHOW PROFILES 语句生成的信息相对应(参见 第 15.7.7.32 节,“SHOW PROFILE 语句”)。除非将 profiling 会话变量设置为 1,否则该表为空。The PROFILING table provides statement profiling information. Its contents correspond to the information produced by the SHOW PROFILE and SHOW PROFILES statements (see Section 15.7.7.32, “SHOW PROFILE Statement”). The table is empty unless the profiling session variable is set to 1.

Note

此表已被弃用;预计将在未来的 MySQL 版本中删除。请改用 Performance Schema;参见 第 29.19.1 节,“使用性能模式进行查询分析”。This table is deprecated; expect it to be removed in a future MySQL release. Use the Performance Schema instead; see Section 29.19.1, “Query Profiling Using Performance Schema”.

PROFILING 表包含以下列:The PROFILING table has these columns:

  • QUERY_ID

    数字型语句标识符。A numeric statement identifier.

  • SEQ

    用于指示具有相同 QUERY_ID 值的行显示顺序的序列号。A sequence number indicating the display order for rows with the same QUERY_ID value.

  • STATE

    行测量适用的分析状态。The profiling state to which the row measurements apply.

  • DURATION

    语句执行在给定状态下持续的时间,以秒为单位。How long statement execution remained in the given state, in seconds.

  • CPU_USER, CPU_SYSTEM

    用户和系统 CPU 使用时间,以秒为单位。User and system CPU use, in seconds.

  • CONTEXT_VOLUNTARY, CONTEXT_INVOLUNTARY

    发生的自愿和非自愿上下文切换次数。How many voluntary and involuntary context switches occurred.

  • BLOCK_OPS_IN, BLOCK_OPS_OUT

    块输入和输出操作的数量。The number of block input and output operations.

  • MESSAGES_SENT, MESSAGES_RECEIVED

    发送和接收的通信消息数量。The number of communication messages sent and received.

  • PAGE_FAULTS_MAJOR, PAGE_FAULTS_MINOR

    主要和次要缺页错误的数量。The number of major and minor page faults.

  • SWAPSSWAPS

    发生的换页次数。How many swaps occurred.

  • SOURCE_FUNCTION、SOURCE_FILE 和 SOURCE_LINESOURCE_FUNCTION, SOURCE_FILE, and SOURCE_LINE

    指示被分析状态在源代码中执行位置的信息。Information indicating where in the source code the profiled state executes.

注意事项Notes

  • PROFILING 是一个非标准的 INFORMATION_SCHEMA 表。PROFILING is a nonstandard INFORMATION_SCHEMA table.

性能分析信息也可以通过 SHOW PROFILE 和 SHOW PROFILES 语句获取。参见 第 15.7.7.32 节,“SHOW PROFILE 语句”。例如,以下查询是等价的:Profiling information is also available from the SHOW PROFILE and SHOW PROFILES statements. See Section 15.7.7.32, “SHOW PROFILE Statement”. For example, the following queries are equivalent:

SHOW PROFILE FOR QUERY 2;

SELECT STATE, FORMAT(DURATION, 6) AS DURATION
FROM INFORMATION_SCHEMA.PROFILING
WHERE QUERY_ID = 2 ORDER BY SEQ;