clickhouse query log

查询当前进行中的query

SELECT
    query_id,
    read_rows,
    total_rows_approx,
    memory_usage,
    initial_user,
    initial_address,
    elapsed,
    query,
    client_hostname
FROM system.processes;

 

查询最后一个状态为”查询完成“的query

SELECT * FROM system.query_log WHERE type = 'QueryFinish' ORDER BY query_start_time DESC LIMIT 1 FORMAT Vertical;

查看是否复制失败

SELECT database, table, is_leader, total_replicas,active_replicas FROM system.replicas  WHERE is_readonly  OR is_session_expired OR future_parts > 20  OR parts_to_check > 10  OR queue_size > 20 OR inserts_in_queue > 10  OR log_max_index - log_pointer > 10  OR total_replicas < 2  OR active_replicas < total_replicas;

你可能感兴趣的:(大数据,数据库)