<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="sys-statement-analysis">
      </a>
      30.4.3.35 The statement_analysis and x$statement_analysis Views
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045062229072">
  </a>
  <a class="indexterm" name="idm46045062227616">
  </a>
  <a class="indexterm" name="idm46045062226128">
  </a>
  <a class="indexterm" name="idm46045062224624">
  </a>
  <p>
   These views list normalized statements with aggregated
          statistics. The content mimics the MySQL Enterprise Monitor
          Query Analysis view. By default, rows are sorted by descending
          total latency.
  </p>
  <p>
   The
   <a class="link" href="sys-statement-analysis.html" title="30.4.3.35 The statement_analysis and x$statement_analysis Views">
    <code class="literal">
     statement_analysis
    </code>
   </a>
   and
   <a class="link" href="sys-statement-analysis.html" title="30.4.3.35 The statement_analysis and x$statement_analysis Views">
    <code class="literal">
     x$statement_analysis
    </code>
   </a>
   views have
          these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       query
      </code>
     </p>
     <p>
      The normalized statement string.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       db
      </code>
     </p>
     <p>
      The default database for the statement, or
      <code class="literal">
       NULL
      </code>
      if there is none.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       full_scan
      </code>
     </p>
     <p>
      The total number of full table scans performed by
              occurrences of the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       exec_count
      </code>
     </p>
     <p>
      The total number of times the statement has executed.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       err_count
      </code>
     </p>
     <p>
      The total number of errors produced by occurrences of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       warn_count
      </code>
     </p>
     <p>
      The total number of warnings produced by occurrences of
              the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       total_latency
      </code>
     </p>
     <p>
      The total wait time of timed occurrences of the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       max_latency
      </code>
     </p>
     <p>
      The maximum single wait time of timed occurrences of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       avg_latency
      </code>
     </p>
     <p>
      The average wait time per timed occurrence of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       lock_latency
      </code>
     </p>
     <p>
      The total time waiting for locks by timed occurrences of
              the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       cpu_latency
      </code>
     </p>
     <p>
      The time spent on CPU for the current thread.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_sent
      </code>
     </p>
     <p>
      The total number of rows returned by occurrences of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_sent_avg
      </code>
     </p>
     <p>
      The average number of rows returned per occurrence of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_examined
      </code>
     </p>
     <p>
      The total number of rows read from storage engines by
              occurrences of the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_examined_avg
      </code>
     </p>
     <p>
      The average number of rows read from storage engines per
              occurrence of the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_affected
      </code>
     </p>
     <p>
      The total number of rows affected by occurrences of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_affected_avg
      </code>
     </p>
     <p>
      The average number of rows affected per occurrence of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tmp_tables
      </code>
     </p>
     <p>
      The total number of internal in-memory temporary tables
              created by occurrences of the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       tmp_disk_tables
      </code>
     </p>
     <p>
      The total number of internal on-disk temporary tables
              created by occurrences of the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       rows_sorted
      </code>
     </p>
     <p>
      The total number of rows sorted by occurrences of the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       sort_merge_passes
      </code>
     </p>
     <p>
      The total number of sort merge passes by occurrences of
              the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       max_controlled_memory
      </code>
     </p>
     <p>
      The maximum amount of controlled memory (bytes) used by
              the statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       max_total_memory
      </code>
     </p>
     <p>
      The maximum amount of memory (bytes) used by the
              statement.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       digest
      </code>
     </p>
     <p>
      The statement digest.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       first_seen
      </code>
     </p>
     <p>
      The time at which the statement was first seen.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       last_seen
      </code>
     </p>
     <p>
      The time at which the statement was most recently seen.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
