Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code DEF204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

Rechercher dans le manuel MySQL

25.39.29 The INFORMATION_SCHEMA INNODB_TRX Table

The INNODB_TRX table provides information about every transaction (excluding read-only transactions) currently executing inside InnoDB, including whether the transaction is waiting for a lock, when the transaction started, and the SQL statement the transaction is executing, if any.

For usage information, see Section 15.14.2.1, “Using InnoDB Transaction and Locking Information”.

The INNODB_TRX table has these columns:

  • TRX_ID

    A unique transaction ID number, internal to InnoDB. These IDs are not created for transactions that are read only and nonlocking. For details, see Section 8.5.3, “Optimizing InnoDB Read-Only Transactions”.

  • TRX_WEIGHT

    The weight of a transaction, reflecting (but not necessarily the exact count of) the number of rows altered and the number of rows locked by the transaction. To resolve a deadlock, InnoDB selects the transaction with the smallest weight as the victim to roll back. Transactions that have changed nontransactional tables are considered heavier than others, regardless of the number of altered and locked rows.

  • TRX_STATE

    The transaction execution state. Permitted values are RUNNING, LOCK WAIT, ROLLING BACK, and COMMITTING.

  • TRX_STARTED

    The transaction start time.

  • TRX_REQUESTED_LOCK_ID

    The ID of the lock the transaction is currently waiting for, if TRX_STATE is LOCK WAIT; otherwise NULL. To obtain details about the lock, join this column with the ENGINE_LOCK_ID column of the Performance Schema data_locks table.

  • TRX_WAIT_STARTED

    The time when the transaction started waiting on the lock, if TRX_STATE is LOCK WAIT; otherwise NULL.

  • TRX_MYSQL_THREAD_ID

    The MySQL thread ID. To obtain details about the thread, join this column with the ID column of the INFORMATION_SCHEMA PROCESSLIST table, but see Section 15.14.2.3, “Persistence and Consistency of InnoDB Transaction and Locking Information”.

  • TRX_QUERY

    The SQL statement that is being executed by the transaction.

  • TRX_OPERATION_STATE

    The transaction's current operation, if any; otherwise NULL.

  • TRX_TABLES_IN_USE

    The number of InnoDB tables used while processing the current SQL statement of this transaction.

  • TRX_TABLES_LOCKED

    The number of InnoDB tables that the current SQL statement has row locks on. (Because these are row locks, not table locks, the tables can usually still be read from and written to by multiple transactions, despite some rows being locked.)

  • TRX_LOCK_STRUCTS

    The number of locks reserved by the transaction.

  • TRX_LOCK_MEMORY_BYTES

    The total size taken up by the lock structures of this transaction in memory.

  • TRX_ROWS_LOCKED

    The approximate number or rows locked by this transaction. The value might include delete-marked rows that are physically present but not visible to the transaction.

  • TRX_ROWS_MODIFIED

    The number of modified and inserted rows in this transaction.

  • TRX_CONCURRENCY_TICKETS

    A value indicating how much work the current transaction can do before being swapped out, as specified by the innodb_concurrency_tickets system variable.

  • TRX_ISOLATION_LEVEL

    The isolation level of the current transaction.

  • TRX_UNIQUE_CHECKS

    Whether unique checks are turned on or off for the current transaction. For example, they might be turned off during a bulk data load.

  • TRX_FOREIGN_KEY_CHECKS

    Whether foreign key checks are turned on or off for the current transaction. For example, they might be turned off during a bulk data load.

  • TRX_LAST_FOREIGN_KEY_ERROR

    The detailed error message for the last foreign key error, if any; otherwise NULL.

  • TRX_ADAPTIVE_HASH_LATCHED

    Whether the adaptive hash index is locked by the current transaction. When the adaptive hash index search system is partitioned, a single transaction does not lock the entire adaptive hash index. Adaptive hash index partitioning is controlled by innodb_adaptive_hash_index_parts, which is set to 8 by default.

  • TRX_ADAPTIVE_HASH_TIMEOUT

    Whether to relinquish the search latch immediately for the adaptive hash index, or reserve it across calls from MySQL. When there is no adaptive hash index contention, this value remains zero and statements reserve the latch until they finish. During times of contention, it counts down to zero, and statements release the latch immediately after each row lookup. When the adaptive hash index search system is partitioned (controlled by innodb_adaptive_hash_index_parts), the value remains 0.

  • TRX_IS_READ_ONLY

    A value of 1 indicates the transaction is read only.

  • TRX_AUTOCOMMIT_NON_LOCKING

    A value of 1 indicates the transaction is a SELECT statement that does not use the FOR UPDATE or LOCK IN SHARED MODE clauses, and is executing with autocommit enabled so that the transaction contains only this one statement. When this column and TRX_IS_READ_ONLY are both 1, InnoDB optimizes the transaction to reduce the overhead associated with transactions that change table data.

Example

  1. mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX\G
  2. *************************** 1. row ***************************
  3.                     trx_id: 1510
  4.                  trx_state: RUNNING
  5.                trx_started: 2014-11-19 13:24:40
  6.      trx_requested_lock_id: NULL
  7.           trx_wait_started: NULL
  8.                 trx_weight: 586739
  9.        trx_mysql_thread_id: 2
  10.                  trx_query: DELETE FROM employees.salaries WHERE salary > 65000
  11.        trx_operation_state: updating or deleting
  12.          trx_tables_in_use: 1
  13.          trx_tables_locked: 1
  14.           trx_lock_structs: 3003
  15.      trx_lock_memory_bytes: 450768
  16.            trx_rows_locked: 1407513
  17.          trx_rows_modified: 583736
  18.    trx_concurrency_tickets: 0
  19.        trx_isolation_level: REPEATABLE READ
  20.          trx_unique_checks: 1
  21.     trx_foreign_key_checks: 1
  22. trx_last_foreign_key_error: NULL
  23.  trx_adaptive_hash_latched: 0
  24.  trx_adaptive_hash_timeout: 10000
  25.           trx_is_read_only: 0
  26. trx_autocommit_non_locking: 0

Inhoudsopgave Haut

Notes


Zoek in de MySQL-handleiding

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-innodb-trx-table.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:en Manuel MySQL : https://dev.mysql.com/

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut