Manual:Microsecond Precision in Processlist
From Askmonty.org
| TOC | MariaDB 5.1 Reference Manual: Microsecond Precision in Processlist | Index |
See Also:MariaDB 5.2 Reference Manual, MariaDB 5.3 Reference Manual
SHOW FULL PROCESSLIST and INFORMATION_SCHEMA.PROCESSLIST
In MariaDB, an extra column `TIME_MS` has been added to the INFORMATION_SCHEMA.PROCESSLIST table, as well as to the output of SHOW FULL PROCESSLIST. This column shows the same information as the column `TIME`, but in units of milliseconds with microsecond precision (the unit and precision of the `TIME` column is one second).
The value displayed in the `TIME` and `TIME_MS` columns is the period of time that the given thread has been in its current state. Thus it can be used to check for example how long a thread has been executing the current query, or for how long it has been idle.
mysql> select id, time, time_ms, command, state from information_schema.processlist, (select sleep(2)) t; +----+------+----------+---------+-----------+ | id | time | time_ms | command | state | +----+------+----------+---------+-----------+ | 1 | 2 | 2007.012 | Query | executing | +----+------+----------+---------+-----------+
Note that as a difference to MySQL, in MariaDB the `TIME` column (and also the `TIME_MS` column) are not affected by any setting of @TIMESTAMP. This means that it can be reliably used also for threads that change @TIMESTAMP (such as the replication SQL thread). See also mybug:22047.
As a consequence of this, the `TIME` column of SHOW FULL PROCESSLIST and INFORMATION_SCHEMA.PROCESSLIST can not be used to determine if a slave is lagging behind. For this, use instead the Seconds_Behind_Master column in the output of SHOW SLAVE STATUS.
The addition of the TIME_MS column is based on the microsec_process patch, developed by Percona.



