以下系统变量会影响优化器跟踪:The following system variables affect optimizer tracing:
optimizer_trace:启用或禁用优化器跟踪。参见 第 10.15.8 节,“optimizer_trace 系统变量”。optimizer_trace: Enables or disables optimizer tracing. See Section 10.15.8, “The optimizer_trace System Variable”.optimizer_trace_features:启用或禁用 MySQL 优化器的选定功能,使用此处显示的语法:optimizer_trace_features: Enables or disables selected features of the MySQL Optimizer, using the syntax shown here:SET optimizer_trace_features=
option=value[,option=value][,...]option: {greedy_search | range_optimizer | dynamic_range | repeated_subselect}value: {on | off | default}有关这些功能的效果的更多信息,请参见 第 10.15.10 节,“选择要跟踪的优化器功能”。See Section 10.15.10, “Selecting Optimizer Features to Trace”, for more information on the effects of these.
optimizer_trace_max_mem_size:用于存储所有跟踪的最大内存量。optimizer_trace_max_mem_size: Maximum amount of memory that can be used for storing all traces.optimizer_trace_limit:要显示的优化器跟踪的最大数量。更多信息请参见第 10.15.4 节,“调整跟踪清理”。optimizer_trace_limit: The maximum number of optimizer traces to be shown. See Section 10.15.4, “Tuning Trace Purging”, for more information.optimizer_trace_offset:显示的第一个跟踪的偏移量。请参见第 10.15.4 节,“调整跟踪清理”。optimizer_trace_offset: Offset of the first trace shown. See Section 10.15.4, “Tuning Trace Purging”.end_markers_in_json:如果设置为1,会导致在闭合括号附近重复显示键(如果存在)。这也会影响那些支持此语句的 MySQL 版本中EXPLAIN FORMAT=JSON的输出。参见 第 10.15.9 节,“end_markers_in_json 系统变量”。end_markers_in_json: If set to1, causes the trace to repeat the key (if present) near the closing bracket. This also affects the output ofEXPLAIN FORMAT=JSONin those versions of MySQL which support this statement. See Section 10.15.9, “The end_markers_in_json System Variable”.