# how to find out the table which is locking

**URL:** <https://forums.percona.com/t/how-to-find-out-the-table-which-is-locking/4607>\
**Category:** Other MySQL® Questions\
**Created:** [December 16, 2015, 3:14am UTC](https://forums.percona.com/t/how-to-find-out-the-table-which-is-locking/4607 "2015-12-16T03:14:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elison2000](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@elison2000](https://forums.percona.com/u/elison2000)\
**Post date:** [December 16, 2015, 3:14am UTC](https://forums.percona.com/t/how-to-find-out-the-table-which-is-locking/4607/1 "2015-12-16T03:14:10Z")

</div>

hi,i find some uncommit transactions on table innodb\_trx,how to find out the table which is locking?

root@localhost)[(none)]\>select ‘innodb\_trx’,  
 → trx\_id,  
 → trx\_mysql\_thread\_id thread\_id,  
 → trx\_state,  
 → timestampdiff(second, trx\_started, now()) trx\_elap\_sec,  
 → timestampdiff(second, trx\_wait\_started, now()) wait\_sec,  
 → trx\_rows\_locked rows\_locked,  
 → trx\_rows\_modified rows\_modified,  
 → substring(trx\_query, 1, 60)  
 → from information\_schema.innodb\_trx  
 → order by trx\_elap\_sec desc, wait\_sec desc;  
±-----------±---------±----------±----------±-------------±---------±------------±--------------±----------------------------+  
| innodb\_trx | trx\_id | thread\_id | trx\_state | trx\_elap\_sec | wait\_sec | rows\_locked | rows\_modified | substring(trx\_query, 1, 60) |  
±-----------±---------±----------±----------±-------------±---------±------------±--------------±----------------------------+  
| innodb\_trx | 8A006C5D | 10088406 | RUNNING | 100949 | NULL | 2 | 7 | NULL |  
±-----------±---------±----------±----------±-------------±---------±------------±--------------±----------------------------+  
1 row in set (0.00 sec)

---

<div class="post-metadata">

**Author:** ![elison2000](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@elison2000](https://forums.percona.com/u/elison2000)\
**Post date:** [December 16, 2015, 3:32am UTC](https://forums.percona.com/t/how-to-find-out-the-table-which-is-locking/4607/2 "2015-12-16T03:32:31Z")

</div>

i find below some transaction is executing from information\_schema.innodb\_trx ,i want to tuning that,but i don’t find the sql and table information,who can help me?

2015-12-16 10:00:42  
innodb\_trx 8A006C5D 10088406 RUNNING 80169 NULL 2 7 NULL  
innodb\_trx 8AF4D6D4 10119037 RUNNING 10 NULL 0 0 NULL  
innodb\_trx 8AF4F536 10143800 RUNNING 8 NULL 0 0 NULL  
innodb\_trx 8AF532C3 10122351 RUNNING 5 NULL 0 0 NULL  
innodb\_trx 8AF527F9 10119038 RUNNING 5 NULL 0 0 NULL  
innodb\_trx 8AF532F9 10119034 RUNNING 5 NULL 2 0 NULL  
innodb\_trx 8AF532B6 10122352 RUNNING 5 NULL 0 0 NULL  
innodb\_trx 8AF532B7 10143801 RUNNING 5 NULL 2 0 NULL  
innodb\_trx 8AF58175 10119043 RUNNING 1 NULL 0 0 NULL  
innodb\_trx 8AF57880 10119036 RUNNING 1 NULL 0 0 NULL  
innodb\_trx 8AF5789D 10245006 RUNNING 1 NULL 2 0 NULL  
innodb\_trx 8AF5873C 10132546 RUNNING 0 NULL 0 0 SELECT COUNT(\*) FROM ((SELECT F01, F02, F03, F04, F05, F06,  
innodb\_trx 8AF5864C 10132503 RUNNING 0 NULL 0 0 SELECT \* FROM ((SELECT F01, F02, F03, F04, F05, F06, F07, F0  
innodb\_trx 8AF58672 10132542 RUNNING 0 NULL 0 0 SELECT \* FROM ((SELECT F01, F02, F03, F04, F05, F06, F07, F0
