Find pending mutations

Find stuck ALTER/DELETE mutations and why they fail, they block schema changes

clickhouse-client -q "SELECT database, table, mutation_id, latest_fail_reason FROM system.mutations WHERE is_done=0"

tool
clickhouse17 commands
tags
clickhousetroubleshootingdebugmonitoring

More clickhouse commands

  • clickhouse-client -h clickhouse -u default --password <pass> --database mydb

    Open an interactive ClickHouse CLI session

  • clickhouse-client -q 'SHOW DATABASES'

    List all databases in ClickHouse

  • clickhouse-client -q 'SHOW TABLES FROM mydb'

    List all tables in a database

  • clickhouse-client -q "SELECT table, formatReadableSize(sum(bytes)) AS size FROM system.parts WHERE active AND database='mydb' GROUP BY table ORDER BY sum(bytes) DESC"

    Show disk usage of each table in a database, largest first

  • clickhouse-client -q 'SELECT query_id, user, elapsed, query FROM system.processes ORDER BY elapsed DESC'

    List all running queries with elapsed time, longest first

all 17 clickhouse commands