<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-file-summary-tables">
      </a>
      29.12.20.7 File I/O Summary Tables
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045068530848">
  </a>
  <a class="indexterm" name="idm46045068529392">
  </a>
  <a class="indexterm" name="idm46045068527888">
  </a>
  <a class="indexterm" name="idm46045068526384">
  </a>
  <p>
   The Performance Schema maintains file I/O summary tables that
          aggregate information about I/O operations.
  </p>
  <p>
   Example file I/O event summary information:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa1491215"><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>file_summary_by_event_name\G
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<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> 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>
               EVENT_NAME<span class="token punctuation">:</span> wait/io/file/sql/binlog
               COUNT_STAR<span class="token punctuation">:</span> 31
           SUM_TIMER_WAIT<span class="token punctuation">:</span> 8243784888
           MIN_TIMER_WAIT<span class="token punctuation">:</span> 0
           AVG_TIMER_WAIT<span class="token punctuation">:</span> 265928484
           MAX_TIMER_WAIT<span class="token punctuation">:</span> 6490658832
...</span>
<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>file_summary_by_instance\G
<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span>
<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> 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>
                FILE_NAME<span class="token punctuation">:</span> /var/mysql/share/english/errmsg.sys
               EVENT_NAME<span class="token punctuation">:</span> wait/io/file/sql/ERRMSG
               EVENT_NAME<span class="token punctuation">:</span> wait/io/file/sql/ERRMSG
    OBJECT_INSTANCE_BEGIN<span class="token punctuation">:</span> 4686193384
               COUNT_STAR<span class="token punctuation">:</span> 5
           SUM_TIMER_WAIT<span class="token punctuation">:</span> 13990154448
           MIN_TIMER_WAIT<span class="token punctuation">:</span> 26349624
           AVG_TIMER_WAIT<span class="token punctuation">:</span> 2798030607
           MAX_TIMER_WAIT<span class="token punctuation">:</span> 8150662536
...</span></code></pre>
  </div>
  <p>
   Each file I/O summary table has one or more grouping columns
          to indicate how the table aggregates events. Event names refer
          to names of event instruments in the
   <a class="link" href="performance-schema-setup-instruments-table.html" title="29.12.2.3 The setup_instruments Table">
    <code class="literal">
     setup_instruments
    </code>
   </a>
   table:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-file-summary-tables.html" title="29.12.20.7 File I/O Summary Tables">
       <code class="literal">
        file_summary_by_event_name
       </code>
      </a>
      has an
      <code class="literal">
       EVENT_NAME
      </code>
      column. Each row
              summarizes events for a given event name.
     </p>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-file-summary-tables.html" title="29.12.20.7 File I/O Summary Tables">
       <code class="literal">
        file_summary_by_instance
       </code>
      </a>
      has
      <code class="literal">
       FILE_NAME
      </code>
      ,
      <code class="literal">
       EVENT_NAME
      </code>
      , and
      <code class="literal">
       OBJECT_INSTANCE_BEGIN
      </code>
      columns. Each row
              summarizes events for a given file and event name.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Each file I/O summary table has the following summary columns
          containing aggregated values. Some columns are more general
          and have values that are the same as the sum of the values of
          more fine-grained columns. In this way, aggregations at higher
          levels are available directly without the need for
          user-defined views that sum lower-level columns.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       COUNT_STAR
      </code>
      ,
      <code class="literal">
       SUM_TIMER_WAIT
      </code>
      ,
      <code class="literal">
       MIN_TIMER_WAIT
      </code>
      ,
      <code class="literal">
       AVG_TIMER_WAIT
      </code>
      ,
      <code class="literal">
       MAX_TIMER_WAIT
      </code>
     </p>
     <p>
      These columns aggregate all I/O operations.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COUNT_READ
      </code>
      ,
      <code class="literal">
       SUM_TIMER_READ
      </code>
      ,
      <code class="literal">
       MIN_TIMER_READ
      </code>
      ,
      <code class="literal">
       AVG_TIMER_READ
      </code>
      ,
      <code class="literal">
       MAX_TIMER_READ
      </code>
      ,
      <code class="literal">
       SUM_NUMBER_OF_BYTES_READ
      </code>
     </p>
     <p>
      These columns aggregate all read operations, including
      <code class="literal">
       FGETS
      </code>
      ,
      <code class="literal">
       FGETC
      </code>
      ,
      <code class="literal">
       FREAD
      </code>
      , and
      <code class="literal">
       READ
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COUNT_WRITE
      </code>
      ,
      <code class="literal">
       SUM_TIMER_WRITE
      </code>
      ,
      <code class="literal">
       MIN_TIMER_WRITE
      </code>
      ,
      <code class="literal">
       AVG_TIMER_WRITE
      </code>
      ,
      <code class="literal">
       MAX_TIMER_WRITE
      </code>
      ,
      <code class="literal">
       SUM_NUMBER_OF_BYTES_WRITE
      </code>
     </p>
     <p>
      These columns aggregate all write operations, including
      <code class="literal">
       FPUTS
      </code>
      ,
      <code class="literal">
       FPUTC
      </code>
      ,
      <code class="literal">
       FPRINTF
      </code>
      ,
      <code class="literal">
       VFPRINTF
      </code>
      ,
      <code class="literal">
       FWRITE
      </code>
      , and
      <code class="literal">
       PWRITE
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       COUNT_MISC
      </code>
      ,
      <code class="literal">
       SUM_TIMER_MISC
      </code>
      ,
      <code class="literal">
       MIN_TIMER_MISC
      </code>
      ,
      <code class="literal">
       AVG_TIMER_MISC
      </code>
      ,
      <code class="literal">
       MAX_TIMER_MISC
      </code>
     </p>
     <p>
      These columns aggregate all other I/O operations,
              including
      <code class="literal">
       CREATE
      </code>
      ,
      <code class="literal">
       DELETE
      </code>
      ,
      <code class="literal">
       OPEN
      </code>
      ,
      <code class="literal">
       CLOSE
      </code>
      ,
      <code class="literal">
       STREAM_OPEN
      </code>
      ,
      <code class="literal">
       STREAM_CLOSE
      </code>
      ,
      <code class="literal">
       SEEK
      </code>
      ,
      <code class="literal">
       TELL
      </code>
      ,
      <code class="literal">
       FLUSH
      </code>
      ,
      <code class="literal">
       STAT
      </code>
      ,
      <code class="literal">
       FSTAT
      </code>
      ,
      <code class="literal">
       CHSIZE
      </code>
      ,
      <code class="literal">
       RENAME
      </code>
      , and
      <code class="literal">
       SYNC
      </code>
      . There are no byte counts for
              these operations.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The file I/O 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-file-summary-tables.html" title="29.12.20.7 File I/O Summary Tables">
       <code class="literal">
        file_summary_by_event_name
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on (
         <code class="literal">
          EVENT_NAME
         </code>
         )
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      <a class="link" href="performance-schema-file-summary-tables.html" title="29.12.20.7 File I/O Summary Tables">
       <code class="literal">
        file_summary_by_instance
       </code>
      </a>
      :
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         Primary key on
                  (
         <code class="literal">
          OBJECT_INSTANCE_BEGIN
         </code>
         )
        </p>
       </li>
       <li class="listitem">
        <p>
         Index on (
         <code class="literal">
          FILE_NAME
         </code>
         )
        </p>
       </li>
       <li class="listitem">
        <p>
         Index on (
         <code class="literal">
          EVENT_NAME
         </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
          file I/O summary tables. It resets the summary columns to zero
          rather than removing rows.
  </p>
  <p>
   The MySQL server uses several techniques to avoid I/O
          operations by caching information read from files, so it is
          possible that statements you might expect to result in I/O
          events do not do so. You may be able to ensure that I/O does
          occur by flushing caches or restarting the server to reset its
          state.
  </p>
 </div>
 <br/>
</div>
