<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="performance-schema-events-transactions-current-table">
      </a>
      29.12.7.1 The events_transactions_current Table
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045072363776">
  </a>
  <a class="indexterm" name="idm46045072362272">
  </a>
  <p>
   The
   <a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
    <code class="literal">
     events_transactions_current
    </code>
   </a>
   table contains current transaction events. The table stores
          one row per thread showing the current status of the thread's
          most recent monitored transaction event, so there is no system
          variable for configuring the table size. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa31548682"><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_transactions_current <span class="token keyword">LIMIT</span> <span class="token number">1</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>
                      THREAD_ID<span class="token punctuation">:</span> 26
                       EVENT_ID<span class="token punctuation">:</span> 7
                   END_EVENT_ID<span class="token punctuation">:</span> NULL
                     EVENT_NAME<span class="token punctuation">:</span> transaction
                          STATE<span class="token punctuation">:</span> ACTIVE
                         TRX_ID<span class="token punctuation">:</span> NULL
                           GTID<span class="token punctuation">:</span> 3E11FA47-71CA-11E1-9E33-C80AA9429562<span class="token punctuation">:</span>56
                            XID<span class="token punctuation">:</span> NULL
                       XA_STATE<span class="token punctuation">:</span> NULL
                         SOURCE<span class="token punctuation">:</span> transaction.cc<span class="token punctuation">:</span>150
                    TIMER_START<span class="token punctuation">:</span> 420833537900000
                      TIMER_END<span class="token punctuation">:</span> NULL
                     TIMER_WAIT<span class="token punctuation">:</span> NULL
                    ACCESS_MODE<span class="token punctuation">:</span> READ WRITE
                ISOLATION_LEVEL<span class="token punctuation">:</span> REPEATABLE READ
                     AUTOCOMMIT<span class="token punctuation">:</span> NO
           NUMBER_OF_SAVEPOINTS<span class="token punctuation">:</span> 0
NUMBER_OF_ROLLBACK_TO_SAVEPOINT<span class="token punctuation">:</span> 0
    NUMBER_OF_RELEASE_SAVEPOINT<span class="token punctuation">:</span> 0
          OBJECT_INSTANCE_BEGIN<span class="token punctuation">:</span> NULL
               NESTING_EVENT_ID<span class="token punctuation">:</span> 6
             NESTING_EVENT_TYPE<span class="token punctuation">:</span> STATEMENT</span></code></pre>
  </div>
  <p>
   Of the tables that contain transaction event rows,
   <a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
    <code class="literal">
     events_transactions_current
    </code>
   </a>
   is
          the most fundamental. Other tables that contain transaction
          event rows are logically derived from the current events. For
          example, the
   <a class="link" href="performance-schema-events-transactions-history-table.html" title="29.12.7.2 The events_transactions_history Table">
    <code class="literal">
     events_transactions_history
    </code>
   </a>
   and
   <a class="link" href="performance-schema-events-transactions-history-long-table.html" title="29.12.7.3 The events_transactions_history_long Table">
    <code class="literal">
     events_transactions_history_long
    </code>
   </a>
   tables are collections of the most recent transaction 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
          transaction 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
          transaction events, see
   <a class="xref" href="performance-schema-transaction-tables.html" title="29.12.7 Performance Schema Transaction Tables">
    Section 29.12.7, “Performance Schema Transaction Tables”
   </a>
   .
  </p>
  <p>
   The
   <a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
    <code class="literal">
     events_transactions_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 from which the event was
              collected. 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">
       STATE
      </code>
     </p>
     <p>
      The current transaction state. The value is
      <code class="literal">
       ACTIVE
      </code>
      (after
      <a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
       <code class="literal">
        START
              TRANSACTION
       </code>
      </a>
      or
      <a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
       <code class="literal">
        BEGIN
       </code>
      </a>
      ),
      <code class="literal">
       COMMITTED
      </code>
      (after
      <a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
       <code class="literal">
        COMMIT
       </code>
      </a>
      ), or
      <code class="literal">
       ROLLED
              BACK
      </code>
      (after
      <a class="link" href="commit.html" title="15.3.1 START TRANSACTION, COMMIT, and ROLLBACK Statements">
       <code class="literal">
        ROLLBACK
       </code>
      </a>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       TRX_ID
      </code>
     </p>
     <p>
      Unused.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       GTID
      </code>
     </p>
     <p>
      The GTID column contains the value of
      <a class="link" href="replication-options-gtids.html#sysvar_gtid_next">
       <code class="literal">
        gtid_next
       </code>
      </a>
      , which can be
              one of
      <code class="literal">
       ANONYMOUS
      </code>
      ,
      <code class="literal">
       AUTOMATIC
      </code>
      , or a GTID using the format
      <code class="literal">
       UUID:NUMBER
      </code>
      . For transactions that use
      <a class="link" href="replication-options-gtids.html#sysvar_gtid_next">
       <code class="literal">
        gtid_next=AUTOMATIC
       </code>
      </a>
      ,
              which is all normal client transactions, the GTID column
              changes when the transaction commits and the actual GTID
              is assigned. If
      <a class="link" href="replication-options-gtids.html#sysvar_gtid_mode">
       <code class="literal">
        gtid_mode
       </code>
      </a>
      is either
      <code class="literal">
       ON
      </code>
      or
      <code class="literal">
       ON_PERMISSIVE
      </code>
      , the GTID column changes
              to the transaction's GTID. If
      <code class="literal">
       gtid_mode
      </code>
      is either
      <code class="literal">
       OFF
      </code>
      or
      <code class="literal">
       OFF_PERMISSIVE
      </code>
      , the GTID column changes
              to
      <code class="literal">
       ANONYMOUS
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       XID_FORMAT_ID
      </code>
      ,
      <code class="literal">
       XID_GTRID
      </code>
      , and
      <code class="literal">
       XID_BQUAL
      </code>
     </p>
     <p>
      The elements of the XA transaction identifier. They have
              the format described in
      <a class="xref" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       Section 15.3.8.1, “XA Transaction SQL Statements”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       XA_STATE
      </code>
     </p>
     <p>
      The state of the XA transaction. The value is
      <code class="literal">
       ACTIVE
      </code>
      (after
      <a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       <code class="literal">
        XA
              START
       </code>
      </a>
      ),
      <code class="literal">
       IDLE
      </code>
      (after
      <a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       <code class="literal">
        XA
              END
       </code>
      </a>
      ),
      <code class="literal">
       PREPARED
      </code>
      (after
      <a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       <code class="literal">
        XA
              PREPARE
       </code>
      </a>
      ),
      <code class="literal">
       ROLLED BACK
      </code>
      (after
      <a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       <code class="literal">
        XA
              ROLLBACK
       </code>
      </a>
      ), or
      <code class="literal">
       COMMITTED
      </code>
      (after
      <a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       <code class="literal">
        XA
              COMMIT
       </code>
      </a>
      ).
     </p>
     <p>
      On a replica, the same XA transaction can appear in the
      <a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
       <code class="literal">
        events_transactions_current
       </code>
      </a>
      table with different states on different threads. This is
              because immediately after the XA transaction is prepared,
              it is detached from the replica's applier thread, and can
              be committed or rolled back by any thread on the replica.
              The
      <a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
       <code class="literal">
        events_transactions_current
       </code>
      </a>
      table displays the current status of the most recent
              monitored transaction event on the thread, and does not
              update this status when the thread is idle. So the XA
              transaction can still be displayed in the
      <code class="literal">
       PREPARED
      </code>
      state for the original applier
              thread, after it has been processed by another thread. To
              positively identify XA transactions that are still in the
      <code class="literal">
       PREPARED
      </code>
      state and need to be
              recovered, use the
      <a class="link" href="xa-statements.html" title="15.3.8.1 XA Transaction SQL Statements">
       <code class="literal">
        XA
              RECOVER
       </code>
      </a>
      statement rather than the Performance
              Schema transaction tables.
     </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">
       ACCESS_MODE
      </code>
     </p>
     <p>
      The transaction access mode. The value is
      <code class="literal">
       READ
              WRITE
      </code>
      or
      <code class="literal">
       READ ONLY
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       ISOLATION_LEVEL
      </code>
     </p>
     <p>
      The transaction isolation level. The value is
      <a class="link" href="innodb-transaction-isolation-levels.html#isolevel_repeatable-read">
       <code class="literal">
        REPEATABLE READ
       </code>
      </a>
      ,
      <a class="link" href="innodb-transaction-isolation-levels.html#isolevel_read-committed">
       <code class="literal">
        READ COMMITTED
       </code>
      </a>
      ,
      <a class="link" href="innodb-transaction-isolation-levels.html#isolevel_read-uncommitted">
       <code class="literal">
        READ UNCOMMITTED
       </code>
      </a>
      , or
      <a class="link" href="innodb-transaction-isolation-levels.html#isolevel_serializable">
       <code class="literal">
        SERIALIZABLE
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       AUTOCOMMIT
      </code>
     </p>
     <p>
      Whether autocommit mode was enabled when the transaction
              started.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       NUMBER_OF_SAVEPOINTS
      </code>
      ,
      <code class="literal">
       NUMBER_OF_ROLLBACK_TO_SAVEPOINT
      </code>
      ,
      <code class="literal">
       NUMBER_OF_RELEASE_SAVEPOINT
      </code>
     </p>
     <p>
      The number of
      <a class="link" href="savepoint.html" title="15.3.4 SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT Statements">
       <code class="literal">
        SAVEPOINT
       </code>
      </a>
      ,
      <a class="link" href="savepoint.html" title="15.3.4 SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT Statements">
       <code class="literal">
        ROLLBACK TO
              SAVEPOINT
       </code>
      </a>
      , and
      <a class="link" href="savepoint.html" title="15.3.4 SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT Statements">
       <code class="literal">
        RELEASE
              SAVEPOINT
       </code>
      </a>
      statements issued during the
              transaction.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       OBJECT_INSTANCE_BEGIN
      </code>
     </p>
     <p>
      Unused.
     </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.
     </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>
      . (
      <code class="literal">
       TRANSACTION
      </code>
      does not appear because transactions cannot be nested.)
     </p>
    </li>
   </ul>
  </div>
  <p>
   The
   <a class="link" href="performance-schema-events-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
    <code class="literal">
     events_transactions_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-transactions-current-table.html" title="29.12.7.1 The events_transactions_current Table">
    <code class="literal">
     events_transactions_current
    </code>
   </a>
   table. It removes the rows.
  </p>
 </div>
 <br/>
</div>
