<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-error-summary-tables">
      </a>
      29.12.20.11 Error Summary Tables
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045067998416">
  </a>
  <a class="indexterm" name="idm46045067996896">
  </a>
  <a class="indexterm" name="idm46045067995376">
  </a>
  <a class="indexterm" name="idm46045067993856">
  </a>
  <a class="indexterm" name="idm46045067992336">
  </a>
  <a class="indexterm" name="idm46045067990816">
  </a>
  <a class="indexterm" name="idm46045067989296">
  </a>
  <a class="indexterm" name="idm46045067987776">
  </a>
  <a class="indexterm" name="idm46045067986256">
  </a>
  <a class="indexterm" name="idm46045067984736">
  </a>
  <p>
   The Performance Schema maintains summary tables for
          aggregating statistical information about server errors (and
          warnings). For a list of server errors, see
   <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html" target="_top">
    Server Error Message Reference
   </a>
   .
  </p>
  <p>
   Collection of error information is controlled by the
   <code class="literal">
    error
   </code>
   instrument, which is enabled by
          default. Timing information is not collected.
  </p>
  <p>
   Each error summary table has three columns that identify the
          error:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       ERROR_NUMBER
      </code>
      is the numeric error
              value. The value is unique.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ERROR_NAME
      </code>
      is the symbolic error name
              corresponding to the
      <code class="literal">
       ERROR_NUMBER
      </code>
      value. The value is unique.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SQLSTATE
      </code>
      is the SQLSTATE value
              corresponding to the
      <code class="literal">
       ERROR_NUMBER
      </code>
      value. The value is not necessarily unique.
     </p>
    </li>
   </ul>
  </div>
  <p>
   For example, if
   <code class="literal">
    ERROR_NUMBER
   </code>
   is 1050,
   <code class="literal">
    ERROR_NAME
   </code>
   is
   <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_table_exists_error" target="_top">
    <code class="literal">
     ER_TABLE_EXISTS_ERROR
    </code>
   </a>
   and
   <code class="literal">
    SQLSTATE
   </code>
   is
   <code class="literal">
    42S01
   </code>
   .
  </p>
  <p>
   Example error event summary information:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa60251128"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token operator">*</span>
       <span class="token keyword">FROM</span> performance_schema<span class="token punctuation">.</span>events_errors_summary_global_by_error
       <span class="token keyword">WHERE</span> SUM_ERROR_RAISED <span class="token operator">&lt;&gt;</span> <span class="token number">0</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     ERROR_NUMBER<span class="token punctuation">:</span> 1064
       ERROR_NAME<span class="token punctuation">:</span> ER_PARSE_ERROR
        SQL_STATE<span class="token punctuation">:</span> 42000
 SUM_ERROR_RAISED<span class="token punctuation">:</span> 1
SUM_ERROR_HANDLED<span class="token punctuation">:</span> 0
       FIRST_SEEN<span class="token punctuation">:</span> 2016-06-28 07<span class="token punctuation">:</span>34<span class="token punctuation">:</span>02
        LAST_SEEN<span class="token punctuation">:</span> 2016-06-28 07<span class="token punctuation">:</span>34<span class="token punctuation">:</span>02
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 2. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     ERROR_NUMBER<span class="token punctuation">:</span> 1146
       ERROR_NAME<span class="token punctuation">:</span> ER_NO_SUCH_TABLE
        SQL_STATE<span class="token punctuation">:</span> 42S02
 SUM_ERROR_RAISED<span class="token punctuation">:</span> 2
SUM_ERROR_HANDLED<span class="token punctuation">:</span> 0
       FIRST_SEEN<span class="token punctuation">:</span> 2016-06-28 07<span class="token punctuation">:</span>34<span class="token punctuation">:</span>05
        LAST_SEEN<span class="token punctuation">:</span> 2016-06-28 07<span class="token punctuation">:</span>36<span class="token punctuation">:</span>18
<span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 3. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
     ERROR_NUMBER<span class="token punctuation">:</span> 1317
       ERROR_NAME<span class="token punctuation">:</span> ER_QUERY_INTERRUPTED
        SQL_STATE<span class="token punctuation">:</span> 70100
 SUM_ERROR_RAISED<span class="token punctuation">:</span> 1
SUM_ERROR_HANDLED<span class="token punctuation">:</span> 0
       FIRST_SEEN<span class="token punctuation">:</span> 2016-06-28 11<span class="token punctuation">:</span>01<span class="token punctuation">:</span>49
        LAST_SEEN<span class="token punctuation">:</span> 2016-06-28 11<span class="token punctuation">:</span>01<span class="token punctuation">:</span>49</span></code></pre>
  </div>
  <p>
   Each error summary table has one or more grouping columns to
          indicate how the table aggregates errors:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_account_by_error
       </code>
      </a>
      has
      <code class="literal">
       USER
      </code>
      ,
      <code class="literal">
       HOST
      </code>
      , and
      <code class="literal">
       ERROR_NUMBER
      </code>
      columns. Each row
              summarizes events for a given account (user and host
              combination) and error.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_host_by_error
       </code>
      </a>
      has
      <code class="literal">
       HOST
      </code>
      and
      <code class="literal">
       ERROR_NUMBER
      </code>
      columns. Each row
              summarizes events for a given host and error.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_thread_by_error
       </code>
      </a>
      has
      <code class="literal">
       THREAD_ID
      </code>
      and
      <code class="literal">
       ERROR_NUMBER
      </code>
      columns. Each row
              summarizes events for a given thread and error.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_user_by_error
       </code>
      </a>
      has
      <code class="literal">
       USER
      </code>
      and
      <code class="literal">
       ERROR_NUMBER
      </code>
      columns. Each row
              summarizes events for a given user and error.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_global_by_error
       </code>
      </a>
      has an
      <code class="literal">
       ERROR_NUMBER
      </code>
      column. Each row
              summarizes events for a given error.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Each error summary table has these summary columns containing
          aggregated values:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       SUM_ERROR_RAISED
      </code>
     </p>
     <p>
      This column aggregates the number of times the error
              occurred.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SUM_ERROR_HANDLED
      </code>
     </p>
     <p>
      This column aggregates the number of times the error was
              handled by an SQL exception handler.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       FIRST_SEEN
      </code>
      ,
      <code class="literal">
       LAST_SEEN
      </code>
     </p>
     <p>
      Timestamp indicating when the error was first seen and
              most recently seen.
     </p>
    </li>
   </ul>
  </div>
  <p>
   A
   <code class="literal">
    NULL
   </code>
   row in each error summary table is
          used to aggregate statistics for all errors that lie out of
          range of the instrumented errors. For example, if MySQL Server
          errors lie in the range from
   <em class="replaceable">
    <code>
     M
    </code>
   </em>
   to
   <em class="replaceable">
    <code>
     N
    </code>
   </em>
   and an error is raised with
          number
   <em class="replaceable">
    <code>
     Q
    </code>
   </em>
   not in that range, the
          error is aggregated in the
   <code class="literal">
    NULL
   </code>
   row. The
   <code class="literal">
    NULL
   </code>
   row is the row with
   <code class="literal">
    ERROR_NUMBER=0
   </code>
   ,
   <code class="literal">
    ERROR_NAME=NULL
   </code>
   , and
   <code class="literal">
    SQLSTATE=NULL
   </code>
   .
  </p>
  <p>
   The error summary tables have these indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_account_by_error
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on (
         <code class="literal">
          USER
         </code>
         ,
         <code class="literal">
          HOST
         </code>
         ,
         <code class="literal">
          ERROR_NUMBER
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_host_by_error
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on (
         <code class="literal">
          HOST
         </code>
         ,
         <code class="literal">
          ERROR_NUMBER
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_thread_by_error
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on (
         <code class="literal">
          THREAD_ID
         </code>
         ,
         <code class="literal">
          ERROR_NUMBER
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_by_user_by_error
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on (
         <code class="literal">
          USER
         </code>
         ,
         <code class="literal">
          ERROR_NUMBER
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
       <code class="literal">
        events_errors_summary_global_by_error
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on (
         <code class="literal">
          ERROR_NUMBER
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
   </ul>
  </div>
  <p>
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE TABLE
    </code>
   </a>
   is permitted for
          error summary tables. It has these effects:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      For summary tables not aggregated by account, host, or
              user, truncation resets the summary columns to zero or
      <code class="literal">
       NULL
      </code>
      rather than removing rows.
     </p>
    </li>
    <li class="listitem">
     <p>
      For summary tables aggregated by account, host, or user,
              truncation removes rows for accounts, hosts, or users with
              no connections, and resets the summary columns to zero or
      <code class="literal">
       NULL
      </code>
      for the remaining rows.
     </p>
    </li>
   </ul>
  </div>
  <p>
   In addition, each error summary table that is aggregated by
          account, host, user, or thread is implicitly truncated by
          truncation of the connection table on which it depends, or
          truncation of
   <a class="link" href="performance-schema-error-summary-tables.html" title="29.12.20.11 Error Summary Tables">
    <code class="literal">
     events_errors_summary_global_by_error
    </code>
   </a>
   .
          For details, see
   <a class="xref" href="performance-schema-connection-tables.html" title="29.12.8 Performance Schema Connection Tables">
    Section 29.12.8, “Performance Schema Connection Tables”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
