You can use the
information_schema.running_queries view to return information about queries currently running in a database. The view is available in each database and contains one row for each running query in the database. You can use a
SELECT query to return information about each running query as shown in the example below.
Each row has the following columns with information about each running query.
|The ID of the engine that was used to execute the query.
|The name of the engine that was used to execute the query.
|The ID of the account in which the query was executed.
|The user ID that was used to execute the query.
|The query execution start time (UTC).
|The status of the query. Always contains the value ‘RUNNING’.
|The elapsed time in microseconds between
<START_TIME> and the time that the query over ` information_schema.running_queries` returns results.
|The unique identifier of the SQL query.
|Text of the SQL statement.
|The number of rows scanned to return query results.
|The number of bytes scanned from cache and storage.
|The number of rows written.
|The number of bytes written.