TRUNCATE TABLE  resets the statistics columns of the prepared_statements_instances  table. 

## 27.12.7 Performance Schema Transaction Tables 

The Performance Schema instruments transactions. Within the event hierarchy, wait events nest within stage events, which nest within statement events, which nest within transaction events. 

These tables store transaction events: 

• events_transactions_current : The current transaction event for each thread. 

• events_transactions_history : The most recent transaction events that have ended per thread. 

• events_transactions_history_long : The most recent transaction events that have ended globally (across all threads). 

The following sections describe the transaction event tables. There are also summary tables that aggregate information about transaction events; see Section 27.12.20.5, “Transaction Summary Tables” . 

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

## Configuring Transaction Event Collection 

•Configuring Transaction Event Collection 

•Transaction Boundaries 

•Transaction Instrumentation 

•Transactions and Nested Events 

•Transactions and Stored Programs 

•Transactions and Savepoints 

•Transactions and Errors 

To control whether to collect transaction events, set the state of the relevant instruments and consumers: 

•The setup_instruments  table contains an instrument named transaction . Use this instrument to enable or disable collection of individual transaction event classes. 

•The setup_consumers  table contains consumer values with names corresponding to the current and historical transaction event table names. Use these consumers to filter collection of transaction events. 

The transaction  instrument and the events_transactions_current  and events_transactions_history  transaction consumers are enabled by default: 

mysql> SELECT NAME, ENABLED, TIMED FROM performance_schema.setup_instruments WHERE NAME = ’transaction’; +-------------+---------+-------+ | NAME | ENABLED | TIMED | +-------------+---------+-------+ | transaction | YES | YES | +-------------+---------+-------+ mysql> SELECT * FROM performance_schema.setup_consumers WHERE NAME LIKE ’events_transactions%’; 

