The Information Schema PROCESSLIST table contains information about running threads.

It contains the following columns:

ColumnDescriptionAdded
IDConnection identifier.
USERMariaDB User.
HOSTConnecting host.
DBDefault database, or NULL if none.
COMMANDType of command running, corresponding to the Com_ status variables. See Thread Command Values.
TIMESeconds that the thread has been in its current state.
STATECurrent state of the thread.
INFOStatement the thread is executing, or NULL if none.
TIME_MSTime in milliseconds with microsecond precision that the thread has been in its current state (see more).MariaDB 5.1
STAGEThe stage the process is currently in.MariaDB 5.3
MAX_STAGEThe maximum number of stages.MariaDB 5.3
PROGRESSThe progress of the process within the current stage (0-100%).MariaDB 5.3
MEMORY_USEDMemory used by the thread.MariaDB 10.0.1
EXAMINED_ROWSRows examined by the thread.MariaDB 10.0.1
QUERY_IDQuery ID.MariaDB 10.0.5
INFO_BINARYBinary data informationMariaDB 10.1.5

Similar information can also be returned with the SHOW [FULL] PROCESSLIST statement, or the mysqladmin processlist command.

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 MySQL Bug #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.

Note that the PROGRESS field from the information schema, and the PROGRESS field from SHOW PROCESSLIST display different results. SHOW PROCESSLIST shows the total progress, while the information schema shows the progress for the current stage only.. To retrieve a similar "total" Progress value from INFORMATION_SCHEMA.PROCESSLIST as the one from SHOW PROCESSLIST, use

SELECT CASE WHEN Max_Stage < 2 THEN Progress ELSE (Stage-1)/Max_Stage*100+Progress/Max_Stage END 
  AS Progress FROM INFORMATION_SCHEMA.PROCESSLIST;

See also

Comments

Comments loading...
Loading