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.
此表已被弃用;预计将在未来的 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 sameQUERY_IDvalue.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, andSOURCE_LINE指示被分析状态在源代码中执行位置的信息。Information indicating where in the source code the profiled state executes.
注意事项Notes
性能分析信息也可以通过 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;