現在実行中のトランザクションからtrx_mysql_thread_idをメモする
SELECT trx_id,trx_query,trx_mysql_thread_id FROM information_schema.innodb_trx ORDER BY trx_started;
PROCESSLIST_IDに先ほどのtrx_mysql_thread_idを指定する
SELECT THREAD_ID FROM performance_schema.threads WHERE PROCESSLIST_ID =;
THREAD_IDを使ってperformance_schema.events_statements_historyを見ればよい
SELECT * FROM performance_schema.events_statements_history WHERE thread_id = ? ORDER BY TIMER_START