See currently active requests
Read system.processes through a server connection when you need a snapshot of currently active TCP and HTTP requests. It is available independently of the query logging setting.
SELECT query_id, user, interface, elapsed,
query_kind, read_rows, memory_usage, peak_threads_usage
FROM system.processes
ORDER BY elapsed DESC
LIMIT 20
FORMAT csv;A request remains present until its response write completes. Its elapsed time therefore does not describe only the SQL calculation. The observing SELECT can see itself, and another request may finish between your observations.
Use query_id to correlate a snapshot with a later terminal event in system.query_log. memory_usage is current accounted SQL memory in the active snapshot, while peak_memory_usage is the request's peak. peak_threads_usage includes the main query thread; a serial query reports one.
This table is read-only. The is_cancelled field does not provide a server-side cancellation command, and cancellation is unavailable through the documented server interface. If the concern is repeated expensive work, identify its caller and apply appropriate request limits to future work.
See process columns, query history and request limits.