<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="optimizer-features-to-trace">
      </a>
      10.15.10 Selecting Optimizer Features to Trace
     </h3>
    </div>
   </div>
  </div>
  <p>
   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:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <span class="emphasis">
       <em>
        Greedy search
       </em>
      </span>
      : With an
      <em class="replaceable">
       <code>
        N
       </code>
      </em>
      -table join, this could explore
          factorial(
      <em class="replaceable">
       <code>
        N
       </code>
      </em>
      ) plans.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="emphasis">
       <em>
        Range optimizer
       </em>
      </span>
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="emphasis">
       <em>
        Dynamic range optimization
       </em>
      </span>
      : Shown as
      <code class="literal">
       range checked for each record
      </code>
      in
      <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
       <code class="literal">
        EXPLAIN
       </code>
      </a>
      output; each outer row
          causes a re-run of the range optimizer.
     </p>
    </li>
    <li class="listitem">
     <p>
      <span class="emphasis">
       <em>
        Subqueries
       </em>
      </span>
      : A subquery in which the
      <code class="literal">
       WHERE
      </code>
      clause may be executed once per row.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Those features can be excluded from tracing by setting one or more
      switches of the
   <a class="link" href="server-system-variables.html#sysvar_optimizer_trace_features">
    <code class="literal">
     optimizer_trace_features
    </code>
   </a>
   system
      variable to
   <code class="literal">
    OFF
   </code>
   . These switches are listed
      here:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       greedy_search
      </code>
      : Greedy search is not traced.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       range_optimizer
      </code>
      : The range optimizer is not
          traced.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       dynamic_range
      </code>
      : Only the first call to the
          range optimizer on this
      <code class="literal">
       JOIN_TAB::SQL_SELECT
      </code>
      is traced.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       repeated_subselect
      </code>
      : Only the first
          execution of this
      <code class="literal">
       Item_subselect
      </code>
      is traced.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
