2 rows in set (0.01 sec)
session 1:
>lock table t8 write;
Query OK, 0 rows affected (0.01 sec)
session2:
>select count(*) from t8;
session2一直等待
session1 unlock tables;
session2执行
+----------+
| count(*) |
+----------+
| 148 |
+----------+
1 row in set (17.58 sec)
再次查看状态变量
show global status like 'Slow%';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| Slow_launch_threads | 0 |
| Slow_queries | 8 |
+---------------------+-------+
可见没有影响到状态变量