0

我有多个表locked,似乎它们正在阻止其他查询运行。什么可能导致此问题,我该如何预防?在此期间我能做些什么来释放这些locks?我通读了 mysql 文档,但我真的不明白防止这个问题的程序是什么。

+----------+----------+--------+-------------+
| Database | Table    | In_use | Name_locked |
+----------+----------+--------+-------------+
| bd1      | table1   |      0 |           0 |
| bd1      | table2   |      5 |           0 |
| bd1      | table3   |      0 |           0 |
| bd1      | table4   |      1 |           0 |
| bd1      | table5   |      0 |           0 |
| bd1      | table6   |      2 |           0 |
| bd1      | table7   |      4 |           0 |
+----------+----------+--------+-------------+

显示引擎 INNODB 状态;

---TRANSACTION A7DF86B, ACTIVE 10 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 2 lock struct(s), heap size 376, 1 row lock(s)
MySQL thread id 170083, OS thread handle 0x15a8, query id 1780479 23.20.117.233 Server2 Updating
UPDATE table7 SET EId = 'b457200', LEd = '2013-02-19 16:03:34', ELR = 'y', LU = '2013-02-19 16:03:
34' WHERE (ObKey = '79321fc7b5ac')
4

1 回答 1

0

好吧,首先,您应该找到引用这些表的查询并了解它们的使用方式。其次,您可以尝试使用一些查询提示来增加并发性。见http://dev.mysql.com/doc/refman/5.0/en/innodb-locking-reads.html

于 2013-02-19T22:19:06.933 回答