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

MySQL 8.4 参考手册 · 中文镜像

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

打开官方英文原文 ↗

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

MySQL 8.4 参考手册 / 28 个 INFORMATION_SCHEMA 表 / 28.3 INFORMATION_SCHEMA 总表 / 28.3.19 INFORMATION_SCHEMA OPTIMIZER_TRACE 表
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 73%

28.3.19 INFORMATION_SCHEMA OPTIMIZER_TRACE 表28.3.19 The INFORMATION_SCHEMA OPTIMIZER_TRACE Table

OPTIMIZER_TRACE 表提供由优化器追踪功能生成的被追踪语句的信息。要启用追踪,请使用 optimizer_trace 系统变量。有关详细信息,请参阅 第 10.15 节,“追踪优化器”。The OPTIMIZER_TRACE table provides information produced by the optimizer tracing capability for traced statements. To enable tracking, use the optimizer_trace system variable. For details, see Section 10.15, “Tracing the Optimizer”.

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

  • QUERYQUERY

    被追踪语句的文本。The text of the traced statement.

  • TRACE

    追踪信息,格式为 JSON。The trace, in JSON format.

  • MISSING_BYTES_BEYOND_MAX_MEM_SIZE

    每个被记住的跟踪都是一个字符串,随着优化的进行会不断扩展并向其中附加数据。optimizer_trace_max_mem_size 变量设置所有当前被记住的跟踪所使用的总内存量的上限。如果达到该上限,当前跟踪将不会被扩展(因此是不完整的),且 MISSING_BYTES_BEYOND_MAX_MEM_SIZE 列将显示跟踪中缺失的字节数。Each remembered trace is a string that is extended as optimization progresses and appends data to it. The optimizer_trace_max_mem_size variable sets a limit on the total amount of memory used by all currently remembered traces. If this limit is reached, the current trace is not extended (and thus is incomplete), and the MISSING_BYTES_BEYOND_MAX_MEM_SIZE column shows the number of bytes missing from the trace.

  • INSUFFICIENT_PRIVILEGES

    如果跟踪查询使用了具有值为DEFINER的SQL SECURITY的视图或存储过程,则可能除了定义者之外的用户被拒绝查看查询的跟踪。在这种情况下,跟踪显示为空,并且INSUFFICIENT_PRIVILEGES的值为 1。否则,该值为 0。If a traced query uses views or stored routines that have SQL SECURITY with a value of DEFINER, it may be that a user other than the definer is denied from seeing the trace of the query. In that case, the trace is shown as empty and INSUFFICIENT_PRIVILEGES has a value of 1. Otherwise, the value is 0.