56,677
社区成员
发帖
与我相关
我的任务
分享
mysql> show variables like '%long_query_time%';
+-----------------+-----------+
| Variable_name | Value |
+-----------------+-----------+
| long_query_time | 10.000000 |
+-----------------+-----------+
1 row in set (0.01 sec)
mysql> set global long_query_time = 3;
Query OK, 0 rows affected (0.04 sec)
mysql> select @@global.long_query_time;
+--------------------------+
| @@global.long_query_time |
+--------------------------+
| 3.000000 |
+--------------------------+
1 row in set (0.02 sec)
mysql>
C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld.exe, Version: 5.6.25-log (MySQL Community Server (GPL)). started with:
TCP Port: 3306, Named Pipe: (null)
Time Id Command Argument
# Time: 150825 15:57:07
# User@Host: root[root] @ [192.168.100.50] Id: 62
# Query_time: 101.961779 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 6479872
use world;
SET timestamp=1440489427;
update tb set idd = id;
# Time: 150825 15:58:41
# User@Host: root[root] @ [192.168.100.50] Id: 62
# Query_time: 48.266485 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 6479872
SET timestamp=1440489521;
update tb set idd = id;
# Time: 150825 16:00:00
# User@Host: root[root] @ [192.168.100.50] Id: 62
# Query_time: 54.506496 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 6479872
SET timestamp=1440489600;
update tb set idd = id;
# Time: 150825 16:01:57
# User@Host: root[root] @ [192.168.100.50] Id: 65
# Query_time: 38.110867 Lock_time: 0.000000 Rows_sent: 501 Rows_examined: 6479872
SET timestamp=1440489717;
select * from tb where idd >= 1000 and idd <= 1500;