View the process list
MySQLSessionCommand
SELECT id, user, host, db, command, time, state, LEFT(info, 100) AS query FROM performance_schema.processlist WHERE command <> 'Sleep' ORDER BY time DESC;What it does
Lists all non-idle connections, the query they are running and the elapsed time.
When to use it
To diagnose active sessions and long-running queries.
Caution
Shortcut: SHOW FULL PROCESSLIST; performance_schema.processlist provides all columns and can be filtered with WHERE. The time column is in seconds.