<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-status-variable-summary-tables">
      </a>
      29.12.20.12 Status Variable Summary Tables
     </h4>
    </div>
   </div>
  </div>
  <p>
   The Performance Schema makes status variable information
          available in the tables described in
   <a class="xref" href="performance-schema-status-variable-tables.html" title="29.12.15 Performance Schema Status Variable Tables">
    Section 29.12.15, “Performance Schema Status Variable Tables”
   </a>
   .
          It also makes aggregated status variable information available
          in summary tables, described here. Each status variable
          summary table has one or more grouping columns to indicate how
          the table aggregates status values:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_account
       </code>
      </a>
      has
      <code class="literal">
       USER
      </code>
      ,
      <code class="literal">
       HOST
      </code>
      , and
      <code class="literal">
       VARIABLE_NAME
      </code>
      columns to summarize
              status variables by account.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_host
       </code>
      </a>
      has
      <code class="literal">
       HOST
      </code>
      and
      <code class="literal">
       VARIABLE_NAME
      </code>
      columns to summarize
              status variables by the host from which clients connected.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_user
       </code>
      </a>
      has
      <code class="literal">
       USER
      </code>
      and
      <code class="literal">
       VARIABLE_NAME
      </code>
      columns to summarize
              status variables by client user name.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Each status variable summary table has this summary column
          containing aggregated values:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       VARIABLE_VALUE
      </code>
     </p>
     <p>
      The aggregated status variable value for active and
              terminated sessions.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The status variable 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-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_account
       </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">
          VARIABLE_NAME
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_host
       </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">
          VARIABLE_NAME
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_user
       </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">
          VARIABLE_NAME
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
   </ul>
  </div>
  <p>
   The meaning of
   <span class="quote">
    “
    <span class="quote">
     account
    </span>
    ”
   </span>
   in these tables is
          similar to its meaning in the MySQL grant tables in the
   <code class="literal">
    mysql
   </code>
   system database, in the sense that
          the term refers to a combination of user and host values. They
          differ in that, for grant tables, the host part of an account
          can be a pattern, whereas for Performance Schema tables, the
          host value is always a specific nonpattern host name.
  </p>
  <p>
   Account status is collected when sessions terminate. The
          session status counters are added to the global status
          counters and the corresponding account status counters. If
          account statistics are not collected, the session status is
          added to host and user status, if host and user status are
          collected.
  </p>
  <p>
   Account, host, and user statistics are not collected if the
   <a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_accounts_size">
    <code class="literal">
     performance_schema_accounts_size
    </code>
   </a>
   ,
   <a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_hosts_size">
    <code class="literal">
     performance_schema_hosts_size
    </code>
   </a>
   ,
          and
   <a class="link" href="performance-schema-system-variables.html#sysvar_performance_schema_users_size">
    <code class="literal">
     performance_schema_users_size
    </code>
   </a>
   system variables, respectively, are set to 0.
  </p>
  <p>
   The Performance Schema supports
   <a class="link" href="truncate-table.html" title="15.1.37 TRUNCATE TABLE Statement">
    <code class="literal">
     TRUNCATE
          TABLE
    </code>
   </a>
   for status variable summary tables as follows;
          in all cases, status for active sessions is unaffected:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_account
       </code>
      </a>
      : Aggregates
              account status from terminated sessions to user and host
              status, then resets account status.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_host
       </code>
      </a>
      : Resets
              aggregated host status from terminated sessions.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-status-variable-summary-tables.html" title="29.12.20.12 Status Variable Summary Tables">
       <code class="literal">
        status_by_user
       </code>
      </a>
      : Resets
              aggregated user status from terminated sessions.
     </p>
    </li>
   </ul>
  </div>
  <p>
   <a class="link" href="flush.html#flush-status">
    <code class="literal">
     FLUSH STATUS
    </code>
   </a>
   adds the session
          status from all active sessions to the global status
          variables, resets the status of all active sessions, and
          resets account, host, and user status values aggregated from
          disconnected sessions.
  </p>
 </div>
 <br/>
</div>
