那时候您会发现flush table处于阻塞状态澳门永利娱乐总站,此时你会意识flush table处于阻塞状态

 

 

近来遇到八个案例,很多询问被打断没有回来结果,使用show
processlist查看,发现许多MySQL线程处于Waiting for table
flush状态,查询语句一向被卡住,只好通过Kill进程来缓解。那么咱们先来探望Waiting
for table
flush的合法说明:https://dev.mysql.com/doc/refman/5.6/en/general-thread-states.html

前不久境遇1个案例,很多询问被卡住没有回到结果,使用show
processlist查看,发现许多MySQL线程处于Waiting for table
flush状态,查询语句平素被打断,只可以通过Kill进程来解决。那么大家先来看看Waiting
for table
flush的官方表明:https://dev.mysql.com/doc/refman/5.6/en/general-thread-states.html

 

 

Waiting
for table flush

Waiting
for table flush

 

 

The
thread is executing FLUSH TABLES and is
waiting for all threads to close their tables, or the thread got a
notification that the underlying structure for a table has changed and
it needs to reopen the table to get the new structure. However, to
reopen the table, it must wait until all other threads have closed the
table in question.

The
thread is executing FLUSH TABLES and is
waiting for all threads to close their tables, or the thread got a
notification that the underlying structure for a table has changed and
it needs to reopen the table to get the new structure. However, to
reopen the table, it must wait until all other threads have closed the
table in question.

This
notification takes place if another thread has used FLUSH
TABLES or one of the following statements on the table in
question: FLUSH TABLES tbl_name, ALTER TABLE, RENAME
TABLE, REPAIR TABLE, ANALYZE
TABLE, or OPTIMIZE
TABLE.

This
notification takes place if another thread has used FLUSH
TABLES or one of the following statements on the table in
question: FLUSH TABLES tbl_name, ALTER TABLE, RENAME
TABLE, REPAIR TABLE, ANALYZE
TABLE, or OPTIMIZE
TABLE.

 

 

 

 

那正是说大家接下去模拟一下线程处于Waiting
for table flush状态的景色,如所示:

那便是说大家接下去模拟一下线程处于Waiting
for table flush状态的情形,如所示:

 

 

在第③个会话连接(connection
id=13)中,大家使用lock table 锁定表test。 

在首先个会话连接(connection
id=13)中,大家运用lock table 锁定表test。 

 

 

mysql> use MyDB;

Database changed

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              13 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> lock table test read;

Query OK, 0 rows affected (0.00 sec)

 

mysql> 
mysql> use MyDB;

Database changed

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              13 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> lock table test read;

Query OK, 0 rows affected (0.00 sec)

 

mysql> 

 

 

 

 

 

 

在其次个会话连接(connection
id=17)中,我们履行flush table 或 flush table test
皆可。此时您会发觉flush table处于阻塞状态。

在其次个会话连接(connection
id=17)中,我们执行flush table 或 flush table test
皆可。此时你会发觉flush table处于阻塞状态。

 

 

mysql> use MyDB;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              17 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> flush table test;
mysql> use MyDB;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              17 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> flush table test;

 

 

 

 

澳门永利娱乐总站 1

澳门永利娱乐总站 2

 

 

 

 

在第三个会话/连接中,当你切换来MyDB时,就会唤起“You
can turn off this feature to get a quicker startup with -A”
,此时处于阻塞状态。此时你退出会话,使用参数-A登录数据库后,你只要查询test表,就会处于阻塞状态(理所当然查询任何表不会被堵塞)。如下所示:

在第多个会话/连接中,当你切换成MyDB时,就会提示“You
can turn off this feature to get a quicker startup with -A”
,此时高居阻塞状态。此时你退出会话,使用参数-A登录数据库后,你即便查询test表,就会处于阻塞状态(自然查询任何表不会被封堵)。如下所示:

 

 

mysql>
use MyDB;

mysql>
use MyDB;

Reading
table information for completion of table and column names

Reading
table information for completion of table and column names

You
can turn off this feature to get a quicker startup with -A

You
can turn off this feature to get a quicker startup with -A

 

 

 

 

mysql>
use MyDB;

mysql>
use MyDB;

Database
changed

Database
changed

mysql>
select * from test;

mysql>
select * from test;

 

 

澳门永利娱乐总站 3

澳门永利娱乐总站 4

 

 

 

 

在第7个会话/连接,我们用show
processlist查看到眼下数据库全数连接线程状态,你会看出1七 、18都处在Waiting
for table flush的意况。如下截图所示:

在第陆个会话/连接,大家用show
processlist查看到眼下数据库全体连接线程状态,你会看到1七 、18都处于Waiting
for table flush的境况。如下截图所示:

 

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info               |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| 13 | root | localhost | MyDB | Sleep   |   90 |                         | NULL               |

| 14 | root | localhost | NULL | Query   |    0 | init                    | show processlist   |

| 17 | root | localhost | MyDB | Query   |   52 | Waiting for table flush | flush table test   |

| 18 | root | localhost | MyDB | Query   |    9 | Waiting for table flush | select * from test |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

4 rows in set (0.00 sec)

 

mysql> 
mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info               |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| 13 | root | localhost | MyDB | Sleep   |   90 |                         | NULL               |

| 14 | root | localhost | NULL | Query   |    0 | init                    | show processlist   |

| 17 | root | localhost | MyDB | Query   |   52 | Waiting for table flush | flush table test   |

| 18 | root | localhost | MyDB | Query   |    9 | Waiting for table flush | select * from test |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

4 rows in set (0.00 sec)

 

mysql> 

 

 

澳门永利娱乐总站 5

澳门永利娱乐总站 6

 

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info               |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| 13 | root | localhost | MyDB | Sleep   |   90 |                         | NULL               |

| 14 | root | localhost | NULL | Query   |    0 | init                    | show processlist   |

| 17 | root | localhost | MyDB | Query   |   52 | Waiting for table flush | flush table test   |

| 18 | root | localhost | MyDB | Query   |    9 | Waiting for table flush | select * from test |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

4 rows in set (0.00 sec)

 

mysql> 

mysql> 

mysql> 

mysql> 

mysql> show open tables where in_use >=1;

+----------+-------+--------+-------------+

| Database | Table | In_use | Name_locked |

+----------+-------+--------+-------------+

| MyDB     | test  |      1 |           0 |

+----------+-------+--------+-------------+

1 row in set (0.00 sec)

 

mysql> kill 17;

Query OK, 0 rows affected (0.00 sec)

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info               |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| 13 | root | localhost | MyDB | Sleep   |  442 |                         | NULL               |

| 14 | root | localhost | NULL | Query   |    0 | init                    | show processlist   |

| 18 | root | localhost | MyDB | Query   |  361 | Waiting for table flush | select * from test |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

3 rows in set (0.00 sec)

 

mysql> kill 13;

Query OK, 0 rows affected (0.00 sec)

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------+------------------+

| Id | User | Host      | db   | Command | Time | State | Info             |

+----+------+-----------+------+---------+------+-------+------------------+

| 14 | root | localhost | NULL | Query   |    0 | init  | show processlist |

| 18 | root | localhost | MyDB | Sleep   |  427 |       | NULL             |

+----+------+-----------+------+---------+------+-------+------------------+

2 rows in set (0.00 sec)

 

mysql> 
mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info               |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| 13 | root | localhost | MyDB | Sleep   |   90 |                         | NULL               |

| 14 | root | localhost | NULL | Query   |    0 | init                    | show processlist   |

| 17 | root | localhost | MyDB | Query   |   52 | Waiting for table flush | flush table test   |

| 18 | root | localhost | MyDB | Query   |    9 | Waiting for table flush | select * from test |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

4 rows in set (0.00 sec)

 

mysql> 

mysql> 

mysql> 

mysql> 

mysql> show open tables where in_use >=1;

+----------+-------+--------+-------------+

| Database | Table | In_use | Name_locked |

+----------+-------+--------+-------------+

| MyDB     | test  |      1 |           0 |

+----------+-------+--------+-------------+

1 row in set (0.00 sec)

 

mysql> kill 17;

Query OK, 0 rows affected (0.00 sec)

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info               |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

| 13 | root | localhost | MyDB | Sleep   |  442 |                         | NULL               |

| 14 | root | localhost | NULL | Query   |    0 | init                    | show processlist   |

| 18 | root | localhost | MyDB | Query   |  361 | Waiting for table flush | select * from test |

+----+------+-----------+------+---------+------+-------------------------+--------------------+

3 rows in set (0.00 sec)

 

mysql> kill 13;

Query OK, 0 rows affected (0.00 sec)

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------+------------------+

| Id | User | Host      | db   | Command | Time | State | Info             |

+----+------+-----------+------+---------+------+-------+------------------+

| 14 | root | localhost | NULL | Query   |    0 | init  | show processlist |

| 18 | root | localhost | MyDB | Sleep   |  427 |       | NULL             |

+----+------+-----------+------+---------+------+-------+------------------+

2 rows in set (0.00 sec)

 

mysql> 

 

 

|
澳门永利娱乐总站 7

|
澳门永利娱乐总站 8

 

 

留意:我们需求Kill线程13,
Kill掉线程17是化解不了问题的。

瞩目:大家需求Kill线程13,
Kill掉线程17是消除不了难题的。

 

 

 

 

 

 

生儿育女条件中,很多时候或然不是lock
table read引起的短路,而是由于慢查询,导致flush
table一贯不能关闭该表而直白处于等候境况,例如上边测试案例中,作者使用相同张大表做笛Carl积模拟多个慢查询,其它操作相同,如下所示,你会看到同一发出了Waiting
for table flush

生儿育女环境中,很多时候恐怕不是lock
table read引起的梗塞,而是由于慢查询,导致flush
table一向不大概关闭该表而直白处于等候状态,例如上边测试案例中,小编使用同样张大表做笛Carl积模拟一个慢查询,其余操作相同,如下所示,你会看到同一发出了Waiting
for table flush

 

 

mysql>
SELECT T.* FROM TEST1 T, TEST1 L;

mysql>
SELECT T.* FROM TEST1 T, TEST1 L;

 

 

澳门永利娱乐总站 9

澳门永利娱乐总站 10

 

 

 

 

除此以外,网上有个案例,mysqldump备份时,假如没有行使参数—single-transaction
或出于同时利用了flush-logs与—single-transaction多个参数也说不定引起这么的等待场景,这一个八个参数放在一块儿,会在初阶dump数据在此以前先进行2个FLUSH
TABLES操作。

别的,网上有个案例,mysqldump备份时,假使没有使用参数—single-transaction
或由于同时使用了flush-logs与—single-transaction三个参数也只怕滋生这么的等候场景,那几个八个参数放在一块儿,会在初步dump数据在此以前先实施贰个FLUSH
TABLES操作。

 

 

 

 

 

 

缓解方案:

化解方案:

** 

** 

 

 

并发Waiting
for table flush时,大家一般供给找到那三个表被lock住或那个慢查询导致flush
table一向在伺机而不能关闭该表。然后Kill掉对应的线程即可,但是怎么着精准定位是3个挑衅,特别是生育环境,你使用show
processlist会看到大批量的线程。让您眼花缭乱的,怎么转眼定位难点呢?

出现Waiting
for table flush时,大家一般必要找到那1个表被lock住或那一个慢查询导致flush
table一直在守候而一筹莫展关闭该表。然后Kill掉对应的线程即可,不过怎么样精准定位是二个挑战,尤其是生育条件,你利用show
processlist会看到大量的线程。让你眼花缭乱的,怎么一转眼定位难题呢?

 

 

对于慢查询引起的别的线程处于Waiting
for table flush状态的图景:

对于慢查询引起的别的线程处于Waiting
for table flush状态的情事:

 

 

能够查看show
processlist中Time值一点都不小的线程。然后甄别确认后Kill掉,如上截图所示,会话连接14正是滋生短路的源头SQL。有种规律便是那几个线程的Time列值必定比被打断的线程要高。这么些就能过滤很多记下。

能够查阅show
processlist中Time值一点都不小的线程。然后甄别确认后Kill掉,如上截图所示,会话连接14正是挑起短路的源头SQL。有种规律正是以此线程的Time列值必定比被卡住的线程要高。这么些就能过滤很多记录。

 

 

对于lock
table read引起的别的线程处于Waiting for table flush状态的图景:

对此lock
table read引起的其它线程处于Waiting for table flush状态的景况:

 

 

对于实验中选用lock
table read那种景观,那种对话只怕处于Sleep状态,而且它也不会油可是生在show
engine innodb status \G命令的出口新闻中。 固然show open tables where
in_use
>=1;能找到是那张表被lock住了,不过力不从心稳定到现实的线程(连接),其实这一个是二个憎恶的难题。可是inntop这款利器就足以固定到,如下所示,线程17锁住了表test,在innotop里面就能一定到是线程17。所谓工欲善其事必先利其器!

对此实验中利用lock
table read那种景况,那种对话大概处于Sleep状态,而且它也不会师世在show
engine innodb status \G命令的输出新闻中。 即便show open tables where
in_use
>=1;能找到是这张表被lock住了,可是力不从心稳定到具体的线程(连接),其实这几个是3个讨厌的题材。不过inntop那款利器就足以一定到,如下所示,线程17锁住了表test,在innotop里面就能固定到是线程17。所谓工欲善其事必先利其器!

 

 

澳门永利娱乐总站 11

澳门永利娱乐总站 12

 

 

澳门永利娱乐总站 13

澳门永利娱乐总站 14

 

 

 

 

 

 

别的,在法定文档中ALTERubiconTABLE, RENAME
TABLE, REPAI大切诺基TABLE, ANALYZE
TABLE, or OPTIMIZE
TABLE都能引起那类等待,上面也做了一些简单易行测试,如下所示:

除此以外,在官方文书档案中ALTE途胜TABLE, RENAME
TABLE, REPAI奥德赛TABLE, ANALYZE
TABLE, or OPTIMIZE
TABLE都能唤起这类等待,下边也做了有个别归纳测试,如下所示:

 

 

 

 

 

 

Waiting
for table flush的别的1个现象

Waiting
for table flush的其它多少个处境

 

 

对话连接(connection
id=18)执行上面SQL语句,模拟1个慢查询SQL

对话连接(connection
id=18)执行下边SQL语句,模拟三个慢查询SQL

 

 

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              18 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select name, sleep(64) from test;
mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              18 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select name, sleep(64) from test;

 

 

对话连接(connection
id=6)执行上面SQL语句,分析表test

对话连接(connection
id=6)执行上面SQL语句,分析表test

 

 

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               6 |

+-----------------+

1 row in set (0.00 sec)

mysql> analyze table test;

+-----------+---------+----------+----------+

| Table     | Op      | Msg_type | Msg_text |

+-----------+---------+----------+----------+

| MyDB.test | analyze | status   | OK       |

+-----------+---------+----------+----------+

1 row in set (0.04 sec)

 

mysql> 
mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               6 |

+-----------------+

1 row in set (0.00 sec)

mysql> analyze table test;

+-----------+---------+----------+----------+

| Table     | Op      | Msg_type | Msg_text |

+-----------+---------+----------+----------+

| MyDB.test | analyze | status   | OK       |

+-----------+---------+----------+----------+

1 row in set (0.04 sec)

 

mysql> 

 

 

对话连接(connection
id=8)执行上边SQL语句

对话连接(connection
id=8)执行下边SQL语句

 

 

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               8 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select * from test;
mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               8 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select * from test;

 

 

翻看线程的气象,你会发现被堵塞的对话处于
Waiting for table flush状态。 因为当对表做了ANALYZE
TABLE后,后台针对该表的询问须要拭目以俟,因为MySQL已经济检察测到该表内部变化,供给利用FLUSH
TABLE关闭然后再也打开该表,所以当你询问该表时,就会处在 Waiting for
table flush

翻开线程的情景,你会发觉被卡住的对话处于
Waiting for table flush状态。 因为当对表做了ANALYZE
TABLE后,后台针对该表的查询必要等待,因为MySQL已经检查和测试到该表内部变化,须求使用FLUSH
TABLE关闭然后再一次打开该表,所以当您询问该表时,就会处于 Waiting for
table flush

 

 

mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+----------------------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info                             |

+----+------+-----------+------+---------+------+-------------------------+----------------------------------+

|  6 | root | localhost | MyDB | Sleep   |   22 |                         | NULL                             |

|  8 | root | localhost | MyDB | Query   |   14 | Waiting for table flush | select * from test               |

| 15 | root | localhost | NULL | Sleep   |    3 |                         | NULL                             |

| 16 | root | localhost | NULL | Query   |    0 | init                    | show processlist                 |

| 18 | root | localhost | MyDB | Query   |   46 | User sleep              | select name, sleep(64) from test |

+----+------+-----------+------+---------+------+-------------------------+----------------------------------+

5 rows in set (0.00 sec)

 

mysql> 
mysql> show processlist;

+----+------+-----------+------+---------+------+-------------------------+----------------------------------+

| Id | User | Host      | db   | Command | Time | State                   | Info                             |

+----+------+-----------+------+---------+------+-------------------------+----------------------------------+

|  6 | root | localhost | MyDB | Sleep   |   22 |                         | NULL                             |

|  8 | root | localhost | MyDB | Query   |   14 | Waiting for table flush | select * from test               |

| 15 | root | localhost | NULL | Sleep   |    3 |                         | NULL                             |

| 16 | root | localhost | NULL | Query   |    0 | init                    | show processlist                 |

| 18 | root | localhost | MyDB | Query   |   46 | User sleep              | select name, sleep(64) from test |

+----+------+-----------+------+---------+------+-------------------------+----------------------------------+

5 rows in set (0.00 sec)

 

mysql> 

 

 

澳门永利娱乐总站 15

澳门永利娱乐总站 16

 

 

 

 

 

 

Waiting
for table metadata lock

Waiting
for table metadata lock

 

 

 

 

对话连接(connection
id=17)执行下边SQL语句,模拟2个慢查询SQL

对话连接(connection
id=17)执行上边SQL语句,模拟1个慢查询SQL

 

 

 

 

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              17 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select name, sleep(100) from test;
mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|              17 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select name, sleep(100) from test;

 

 

 

 

对话连接(connection
id=6)执行上面SQL语句, 修改表结构操作

对话连接(connection
id=6)执行上边SQL语句, 修改表结构操作

 

 

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               6 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> alter table test add tname varchar(10); // rename table test to kkk 同样会引起Waiting for table metadata lock
mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               6 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> alter table test add tname varchar(10); // rename table test to kkk 同样会引起Waiting for table metadata lock

 

 

 

 

对话连接(connection
id=8)执行上边SQL语句,查询表test

对话连接(connection
id=8)执行下边SQL语句,查询表test

 

 

mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               8 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select * from test;
mysql> select connection_id();

+-----------------+

| connection_id() |

+-----------------+

|               8 |

+-----------------+

1 row in set (0.00 sec)

 

mysql> select * from test;

 

 

 

 

查阅线程的动静,你会发觉被打断的对话处于
Waiting for table metadata lock状态。

查阅线程的境况,你会发现被打断的对话处于
Waiting for table metadata lock状态。

 

 

 

 

mysql> show processlist;

+----+------+-----------+------+---------+------+---------------------------------+----------------------------------------+

| Id | User | Host      | db   | Command | Time | State                           | Info                                   |

+----+------+-----------+------+---------+------+---------------------------------+----------------------------------------+

|  6 | root | localhost | MyDB | Query   |   19 | Waiting for table metadata lock | alter table test add tname varchar(10) |

|  8 | root | localhost | MyDB | Query   |    6 | Waiting for table metadata lock | select * from test                     |

| 15 | root | localhost | NULL | Sleep   |    8 |                                 | NULL                                   |

| 16 | root | localhost | NULL | Query   |    0 | init                            | show processlist                       |

| 17 | root | localhost | MyDB | Query   |   55 | User sleep                      | select name, sleep(100) from test      |

+----+------+-----------+------+---------+------+---------------------------------+----------------------------------------+

5 rows in set (0.00 sec)

 

mysql> 
mysql> show processlist;

+----+------+-----------+------+---------+------+---------------------------------+----------------------------------------+

| Id | User | Host      | db   | Command | Time | State                           | Info                                   |

+----+------+-----------+------+---------+------+---------------------------------+----------------------------------------+

|  6 | root | localhost | MyDB | Query   |   19 | Waiting for table metadata lock | alter table test add tname varchar(10) |

|  8 | root | localhost | MyDB | Query   |    6 | Waiting for table metadata lock | select * from test                     |

| 15 | root | localhost | NULL | Sleep   |    8 |                                 | NULL                                   |

| 16 | root | localhost | NULL | Query   |    0 | init                            | show processlist                       |

| 17 | root | localhost | MyDB | Query   |   55 | User sleep                      | select name, sleep(100) from test      |

+----+------+-----------+------+---------+------+---------------------------------+----------------------------------------+

5 rows in set (0.00 sec)

 

mysql> 

 

 

澳门永利娱乐总站 17

澳门永利娱乐总站 18

 

 

 

 

 

 

 

 

参考资料:

参考资料:

 

 

https://www.percona.com/blog/2013/02/27/mysql-optimizer-analyze-table-and-waiting-for-table-flush/

https://www.percona.com/blog/2013/02/27/mysql-optimizer-analyze-table-and-waiting-for-table-flush/

http://www.cnblogs.com/jackhub/p/3841004.html

http://www.cnblogs.com/jackhub/p/3841004.html

http://myrock.github.io/2014/11/20/mysql-waiting-for-table-flush/

http://myrock.github.io/2014/11/20/mysql-waiting-for-table-flush/

http://mysql.taobao.org/monthly/2016/03/10/

http://mysql.taobao.org/monthly/2016/03/10/

相关文章