Advanced filtering options
The display of the Threads is implemented as a SELECT
- query against the embedded database. The initial query is as follows:
SELECT * FROM processlist ORDER BY time DESC;
The ORDER BY clause, here, will display the slowest queries at the top (which is convenient for further investigation). You can define your own sort and filter criteria by editing this query using the WHERE
, ORDER BY
, and even GROUP BY
clauses and AGGREGATES
as you prefer. To change the query simply click on the 'Settings' icon.
For example a user query is as follows:
SELECT user, count(user) as no_of_queries, max(time) as running_longest FROM [processlist] WHERE ((user <> 'Monyog_user') and (command <> 'Sleep')) GROUP BY user;
Note that string comparison is case-sensitive in SQLite and also note the use of [square brackets] in SQLite similar to backquotes in MySQL.
Notice that implementing support for the SHOW FULL PROCESSLIST
command using a SELECT statement gives you much more flexibility over the output than the command does by itself.