Rechercher dans le manuel MySQL

26.12.7.1 The events_transactions_current Table

The events_transactions_current 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:

  1. mysql> SELECT *
  2.        FROM performance_schema.events_transactions_current LIMIT 1\G
  3. *************************** 1. row ***************************
  4.                       THREAD_ID: 26
  5.                        EVENT_ID: 7
  6.                    END_EVENT_ID: NULL
  7.                      EVENT_NAME: transaction
  8.                           STATE: ACTIVE
  9.                          TRX_ID: NULL
  10.                            GTID: 3E11FA47-71CA-11E1-9E33-C80AA9429562:56
  11.                             XID: NULL
  12.                        XA_STATE: NULL
  13.                          SOURCE: transaction.cc:150
  14.                     TIMER_START: 420833537900000
  15.                       TIMER_END: NULL
  16.                      TIMER_WAIT: NULL
  17.                     ACCESS_MODE: READ WRITE
  18.                 ISOLATION_LEVEL: REPEATABLE READ
  19.                      AUTOCOMMIT: NO
  20.            NUMBER_OF_SAVEPOINTS: 0
  21. NUMBER_OF_ROLLBACK_TO_SAVEPOINT: 0
  22.     NUMBER_OF_RELEASE_SAVEPOINT: 0
  23.           OBJECT_INSTANCE_BEGIN: NULL
  24.                NESTING_EVENT_ID: 6
  25.              NESTING_EVENT_TYPE: STATEMENT

Of the tables that contain transaction event rows, events_transactions_current is the most fundamental. Other tables that contain transaction event rows are logically derived from the current events. For example, the events_transactions_history and events_transactions_history_long 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.

For more information about the relationship between the three transaction event tables, see Section 26.9, “Performance Schema Tables for Current and Historical Events”.

For information about configuring whether to collect transaction events, see Section 26.12.7, “Performance Schema Transaction Tables”.

The events_transactions_current table has these columns:

  • THREAD_ID, EVENT_ID

    The thread associated with the event and the thread current event number when the event starts. The THREAD_ID and EVENT_ID values taken together uniquely identify the row. No two rows have the same pair of values.

  • END_EVENT_ID

    This column is set to NULL when the event starts and updated to the thread current event number when the event ends.

  • EVENT_NAME

    The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. Instrument names may have multiple parts and form a hierarchy, as discussed in Section 26.6, “Performance Schema Instrument Naming Conventions”.

  • STATE

    The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK).

  • TRX_ID

    Unused.

  • GTID

    The GTID column contains the value of gtid_next, which can be one of ANONYMOUS, AUTOMATIC, or a GTID using the format UUID:NUMBER. For transactions that use gtid_next=AUTOMATIC, which is all normal client transactions, the GTID column changes when the transaction commits and the actual GTID is assigned. If gtid_mode is either ON or ON_PERMISSIVE, the GTID column changes to the transaction's GTID. If gtid_mode is either OFF or OFF_PERMISSIVE, the GTID column changes to ANONYMOUS.

  • XID_FORMAT_ID, XID_GTRID, and XID_BQUAL

    The components of the XA transaction identifier. They have the format described in Section 13.3.8.1, “XA Transaction SQL Syntax”.

  • XA_STATE

    The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT).

    On a replication slave, the same XA transaction can appear in the events_transactions_current table with different states on different threads. This is because immediately after the XA transaction is prepared, it is detached from the slave applier thread, and can be committed or rolled back by any thread on the slave. The events_transactions_current 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 PREPARED state for the original applier thread, after it has been processed by another thread. To positively identify XA transactions that are still in the PREPARED state and need to be recovered, use the XA RECOVER statement rather than the Performance Schema transaction tables.

  • SOURCE

    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.

  • TIMER_START, TIMER_END, TIMER_WAIT

    Timing information for the event. The unit for these values is picoseconds (trillionths of a second). The TIMER_START and TIMER_END values indicate when event timing started and ended. TIMER_WAIT is the event elapsed time (duration).

    If an event has not finished, TIMER_END is the current timer value and TIMER_WAIT is the time elapsed so far (TIMER_ENDTIMER_START).

    If an event is produced from an instrument that has TIMED = NO, timing information is not collected, and TIMER_START, TIMER_END, and TIMER_WAIT are all NULL.

    For discussion of picoseconds as the unit for event times and factors that affect time values, see Section 26.4.1, “Performance Schema Event Timing”.

  • ACCESS_MODE

    The transaction access mode. The value is READ WRITE or READ ONLY.

  • ISOLATION_LEVEL

    The transaction isolation level. The value is REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE.

  • AUTOCOMMIT

    Whether autcommit mode was enabled when the transaction started.

  • NUMBER_OF_SAVEPOINTS, NUMBER_OF_ROLLBACK_TO_SAVEPOINT, NUMBER_OF_RELEASE_SAVEPOINT

    The number of SAVEPOINT, ROLLBACK TO SAVEPOINT, and RELEASE SAVEPOINT statements issued during the transaction.

  • OBJECT_INSTANCE_BEGIN

    Unused.

  • NESTING_EVENT_ID

    The EVENT_ID value of the event within which this event is nested.

  • NESTING_EVENT_TYPE

    The nesting event type. The value is TRANSACTION, STATEMENT, STAGE, or WAIT. (TRANSACTION will not appear because transactions cannot be nested.)

The events_transactions_current table has these indexes:

  • Primary key on (THREAD_ID, EVENT_ID)

TRUNCATE TABLE is permitted for the events_transactions_current table. It removes the rows.


Suchen Sie im MySQL-Handbuch

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 26/06/2006, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/mysql-rf-events-transactions-current-table.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:en Manuel MySQL : https://dev.mysql.com/

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut