- 论坛徽章:
- 0
|
本帖最后由 viato 于 2013-09-25 11:56 编辑
请教大家,如何按照时间段打印mysql的慢日志,比如打印下面15:13分到18点前的日志- # Time: 130924 14:30:13
- # User@Host: test[test] @ localhost []
- # Query_time: 19.286527 Lock_time: 0.000025 Rows_sent: 0 Rows_examined: 1
- SET timestamp=1380007813;
- DELETE FROM functions WHERE (triggerid IN (15632));
- # Time: 130924 15:13:08
- # User@Host: test[test] @ localhost []
- # Query_time: 19.069534 Lock_time: 0.000064 Rows_sent: 0 Rows_examined: 1
- SET timestamp=1380007813;
- update items set lastclock=1380007790,prevorgvalue='105201685955.000000',prevvalue=lastvalue,lastvalue='16795.633333' where itemid=18440;
- # Time: 130924 17:16:34
- # User@Host: test[test] @ localhost []
- # Query_time: 3.956485 Lock_time: 0.000031 Rows_sent: 0 Rows_examined: 500
- SET timestamp=1380014014;
- delete from trends where itemid=31165 limit 500;
- # User@Host: test[test] @ localhost []
- # Query_time: 9.649595 Lock_time: 0.000051 Rows_sent: 0 Rows_examined: 1
- SET timestamp=1380007813;
- UPDATE sessions SET lastaccess=1380007803 WHERE sessionid='11a6a446e80b9b559c555959f4ca5487';
- # User@Host: test[test] @ localhost []
- # Query_time: 9.193245 Lock_time: 0.000049 Rows_sent: 0 Rows_examined: 0
- use test;
- SET timestamp=1380007813;
- REPLACE INTO settings (name,value) VALUES ('poller_lastrun',1380007803);
- # Time: 130924 16:13:08
- # User@Host: test[test] @ localhost []
- # Query_time: 7.538226 Lock_time: 0.000025 Rows_sent: 0 Rows_examined: 500
- use test;
- SET timestamp=1380010388;
- delete from trends where itemid=24804 limit 500;
- # Time: 130924 17:13:34
- # User@Host: test[test] @ localhost []
- # Query_time: 3.956485 Lock_time: 0.000031 Rows_sent: 0 Rows_examined: 500
- SET timestamp=1380014014;
- delete from trends where itemid=31165 limit 500;
- # Time: 130924 18:13:51
- # User@Host: test[test] @ localhost []
- # Query_time: 3.552062 Lock_time: 0.000019 Rows_sent: 0 Rows_examined: 120
- SET timestamp=1380017631;
- delete from history_uint where itemid=26171 and clock<1379412820;
- # Time: 130924 19:14:15
- # User@Host: test[test] @ localhost []
- # Query_time: 3.631823 Lock_time: 0.000029 Rows_sent: 0 Rows_examined: 77
- SET timestamp=1380021255;
复制代码 |
|