ClickHouse/tests/queries/0_stateless/03097_query_log_join_processes.sql

8 lines
372 B
SQL

-- https://github.com/ClickHouse/ClickHouse/issues/56521
SYSTEM FLUSH LOGS;
SET allow_experimental_analyzer=1;
SELECT count(1) as num, hostName() as hostName FROM system.query_log as a INNER JOIN system.processes as b on a.query_id = b.query_id and type = 'QueryStart' and dateDiff('second', event_time, now()) > 5 and current_database = currentDatabase() FORMAT Null;