<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-events-stages-current-table">
      </a>
      29.12.5.1 The events_stages_current Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045073055680">
  </a>
  <a class="indexterm" name="idm46045073054176">
  </a>
  <p>
   The
   <a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
    <code class="literal">
     events_stages_current
    </code>
   </a>
   table
          contains current stage events. The table stores one row per
          thread showing the current status of the thread's most recent
          monitored stage event, so there is no system variable for
          configuring the table size.
  </p>
  <p>
   Of the tables that contain stage event rows,
   <a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
    <code class="literal">
     events_stages_current
    </code>
   </a>
   is the most
          fundamental. Other tables that contain stage event rows are
          logically derived from the current events. For example, the
   <a class="link" href="performance-schema-events-stages-history-table.html" title="29.12.5.2 The events_stages_history Table">
    <code class="literal">
     events_stages_history
    </code>
   </a>
   and
   <a class="link" href="performance-schema-events-stages-history-long-table.html" title="29.12.5.3 The events_stages_history_long Table">
    <code class="literal">
     events_stages_history_long
    </code>
   </a>
   tables
          are collections of the most recent stage events that have
          ended, up to a maximum number of rows per thread and globally
          across all threads, respectively.
  </p>
  <p>
   For more information about the relationship between the three
          stage event tables, see
   <a class="xref" href="performance-schema-event-tables.html" title="29.9 Performance Schema Tables for Current and Historical Events">
    Section 29.9, “Performance Schema Tables for Current and Historical Events”
   </a>
   .
  </p>
  <p>
   For information about configuring whether to collect stage
          events, see
   <a class="xref" href="performance-schema-stage-tables.html" title="29.12.5 Performance Schema Stage Event Tables">
    Section 29.12.5, “Performance Schema Stage Event Tables”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
    <code class="literal">
     events_stages_current
    </code>
   </a>
   table
          has these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       THREAD_ID
      </code>
      ,
      <code class="literal">
       EVENT_ID
      </code>
     </p>
     <p>
      The thread associated with the event and the thread
              current event number when the event starts. The
      <code class="literal">
       THREAD_ID
      </code>
      and
      <code class="literal">
       EVENT_ID
      </code>
      values taken together uniquely
              identify the row. No two rows have the same pair of
              values.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       END_EVENT_ID
      </code>
     </p>
     <p>
      This column is set to
      <code class="literal">
       NULL
      </code>
      when the
              event starts and updated to the thread current event
              number when the event ends.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       EVENT_NAME
      </code>
     </p>
     <p>
      The name of the instrument that produced the event. This
              is a
      <code class="literal">
       NAME
      </code>
      value from 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.
              Instrument names may have multiple parts and form a
              hierarchy, as discussed in
      <a class="xref" href="performance-schema-instrument-naming.html" title="29.6 Performance Schema Instrument Naming Conventions">
       Section 29.6, “Performance Schema Instrument Naming Conventions”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SOURCE
      </code>
     </p>
     <p>
      The name of the source file containing the instrumented
              code that produced the event and the line number in the
              file at which the instrumentation occurs. This enables you
              to check the source to determine exactly what code is
              involved.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TIMER_START
      </code>
      ,
      <code class="literal">
       TIMER_END
      </code>
      ,
      <code class="literal">
       TIMER_WAIT
      </code>
     </p>
     <p>
      Timing information for the event. The unit for these
              values is picoseconds (trillionths of a second). The
      <code class="literal">
       TIMER_START
      </code>
      and
      <code class="literal">
       TIMER_END
      </code>
      values indicate when event
              timing started and ended.
      <code class="literal">
       TIMER_WAIT
      </code>
      is
              the event elapsed time (duration).
     </p>
     <p>
      If an event has not finished,
      <code class="literal">
       TIMER_END
      </code>
      is the current timer value and
      <code class="literal">
       TIMER_WAIT
      </code>
      is the time elapsed so far
              (
      <code class="literal">
       TIMER_END
      </code>
      −
      <code class="literal">
       TIMER_START
      </code>
      ).
     </p>
     <p>
      If an event is produced from an instrument that has
      <code class="literal">
       TIMED = NO
      </code>
      , timing information is not
              collected, and
      <code class="literal">
       TIMER_START
      </code>
      ,
      <code class="literal">
       TIMER_END
      </code>
      , and
      <code class="literal">
       TIMER_WAIT
      </code>
      are all
      <code class="literal">
       NULL
      </code>
      .
     </p>
     <p>
      For discussion of picoseconds as the unit for event times
              and factors that affect time values, see
      <a class="xref" href="performance-schema-timing.html" title="29.4.1 Performance Schema Event Timing">
       Section 29.4.1, “Performance Schema Event Timing”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       WORK_COMPLETED
      </code>
      ,
      <code class="literal">
       WORK_ESTIMATED
      </code>
     </p>
     <p>
      These columns provide stage progress information, for
              instruments that have been implemented to produce such
              information.
      <code class="literal">
       WORK_COMPLETED
      </code>
      indicates
              how many work units have been completed for the stage, and
      <code class="literal">
       WORK_ESTIMATED
      </code>
      indicates how many work
              units are expected for the stage. For more information,
              see
      <a class="xref" href="performance-schema-stage-tables.html#stage-event-progress" title="Stage Event Progress Information">
       Stage Event Progress Information
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       NESTING_EVENT_ID
      </code>
     </p>
     <p>
      The
      <code class="literal">
       EVENT_ID
      </code>
      value of the event within
              which this event is nested. The nesting event for a stage
              event is usually a statement event.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       NESTING_EVENT_TYPE
      </code>
     </p>
     <p>
      The nesting event type. The value is
      <code class="literal">
       TRANSACTION
      </code>
      ,
      <code class="literal">
       STATEMENT
      </code>
      ,
      <code class="literal">
       STAGE
      </code>
      , or
      <code class="literal">
       WAIT
      </code>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
    <code class="literal">
     events_stages_current
    </code>
   </a>
   table
          has these indexes:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Primary key on (
      <code class="literal">
       THREAD_ID
      </code>
      ,
      <code class="literal">
       EVENT_ID
      </code>
      )
     </p>
    </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
          the
   <a class="link" href="performance-schema-events-stages-current-table.html" title="29.12.5.1 The events_stages_current Table">
    <code class="literal">
     events_stages_current
    </code>
   </a>
   table.
          It removes the rows.
  </p>
 </div>
 <br/>
</div>
