{question}
When executing the following query:
SELECT * FROM information_schema.mv_processlist WHERE state = 'executing';
It currently returns the running queries across all workspaces in a workspace group. Is there a way to filter the results to display only the running queries for a specific workspace?
{question}
{answer}
The mv_processlist view provides information about currently running processes across all nodes in a workspace group.
For example, suppose a workspace group includes two workspaces: ws1and ws2. Even if you are connected only tows1using an SQL client, queryingmv_processlist will still return processes running on ws2.
To view the queries currently running for a specific workspace, follow these steps:
-
Connect directly to the target workspace using a SQL client (e.g.,
mysql, DBeaver). -
Run the following query:
SELECT m.*
FROM information_schema.mv_processlist m
INNER JOIN information_schema.mv_nodes n
ON m.node_id = n.id
WHERE m.state = 'executing';
The mv_nodesview provides metadata about all nodes within the currently connected workspace. By joiningmv_processlistwith mv_nodesthe result will be limited to the current workspace only.
For example, to view active queries inws2, connect directly tows2, and then run the query above. This will return only the currently executing processes in ws2.
{answer}