Documentation Home
MySQL 9.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 41.2Mb
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


MySQL 9.4 Reference Manual  / ...  / Optimization  / Tracing the Optimizer  /  Selecting Optimizer Features to Trace

10.15.10 Selecting Optimizer Features to Trace

Some features in the optimizer can be invoked many times during statement optimization and execution, and thus can make the trace grow beyond reason. They are:

  • Greedy search: With anN-table join, this could explore factorial(N) plans.

  • Range optimizer

  • Dynamic range optimization: Shown asrange checked for each record inEXPLAIN output; each outer row causes a re-run of the range optimizer.

  • Subqueries: A subquery in which theWHERE clause may be executed once per row.

Those features can be excluded from tracing by setting one or more switches of theoptimizer_trace_features system variable toOFF. These switches are listed here:

  • greedy_search: Greedy search is not traced.

  • range_optimizer: The range optimizer is not traced.

  • dynamic_range: Only the first call to the range optimizer on thisJOIN_TAB::SQL_SELECT is traced.

  • repeated_subselect: Only the first execution of thisItem_subselect is traced.