SELECT
user,
query_duration_ms / 1000 AS sec,
query,
query_start_time AS started,
round(memory_usage / 1048576) AS MEM_MB,
result_rows AS RES_CNT,
result_bytes / 1048576 AS RES_MB,
read_rows AS R_CNT,
round(read_bytes / 1048576) AS R_MB,
written_rows AS W_CNT,
round(written_bytes / 1048576) AS W_MB,
client_hostname AS host,
client_name AS client
FROM system.query_log
WHERE type = 2 and query_start_time>'2024-11-18 17:37:15' and query_start_time<'2024-11-18 17:50:15'
ORDER BY query_duration_ms DESC
user,
query_duration_ms / 1000 AS sec,
query,
query_start_time AS started,
round(memory_usage / 1048576) AS MEM_MB,
result_rows AS RES_CNT,
result_bytes / 1048576 AS RES_MB,
read_rows AS R_CNT,
round(read_bytes / 1048576) AS R_MB,
written_rows AS W_CNT,
round(written_bytes / 1048576) AS W_MB,
client_hostname AS host,
client_name AS client
FROM system.query_log
WHERE type = 2 and query_start_time>'2024-11-18 17:37:15' and query_start_time<'2024-11-18 17:50:15'
ORDER BY query_duration_ms DESC