MySQL slow queries

MySQL's slow query log often shows the sequence of the following entries in sequence.

SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 4.172700 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 3.628924 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 3.116018 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 ... 

Usually 6-7 β€œcommit” requests in sequence. Whoever, and what is the previous request of each of them?

Thanks in advance.

+7
performance mysql
source share
1 answer

the set timestamp command affects the value returned by now and the value that automatic timestamp columns get when their rows change.

this is necessary for replication and reproduction of the journal. query semantics, depending on the current time, will always match exactly. (note sysdate ignores set timestamp unlike now )

the log will ensure that the timestamp is recorded using set timestamp whenever a new connection, mysql ping, or any statement is made.

+3
source share

All Articles