In an earlier post titled “How to work with a long process list in MySQL”, we showed a neat way to work with the process list by using various shell tools. But some of that can also be done using pure SQL.
Since version 5.0 a lot of MySQL meta and runtime information can
be accessed by reading from predefined views in a database called
INFORMATION_SCHEMA
. The information which can be
found there includes lists of threads, tables, user created
views, triggers, stored procedures and many, many other things.
The newer the MySQL version, the more items can found in there.
This post is about the process list, so it will focus on just one
of the tables called PROCESSLIST
. Its structure is
virtually identical to what SHOW PROCESSLIST
command
returns.
mysql> DESC …[Read more]