Show tables

List all tables in a database

clickhouse-client -q 'SHOW TABLES FROM mydb'

tool
clickhouse17 commands
tags
clickhouse

More clickhouse commands

  • 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 per table in a database

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

    List all currently running queries with elapsed time

  • clickhouse-client -q "KILL QUERY WHERE query_id='<id>'"

    Terminate a long-running or stuck query

  • clickhouse-client -q 'SYSTEM DROP MARK CACHE; SYSTEM DROP UNCOMPRESSED CACHE'

    Flush ClickHouse caches to free memory

  • clickhouse-client -q 'SYSTEM SYNC REPLICA mydb.myTable'

    Force replica to sync with ZooKeeper state

all 17 clickhouse commands