Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kymtwyf/557cc46c576636caa778f88c9066ed38 to your computer and use it in GitHub Desktop.
Save kymtwyf/557cc46c576636caa778f88c9066ed38 to your computer and use it in GitHub Desktop.
clickhouse get tables size
select concat(database, '.', table) as table,
formatReadableSize(sum(bytes)) as size,
sum(rows) as rows,
max(modification_time) as latest_modification,
sum(bytes) as bytes_size,
any(engine) as engine,
formatReadableSize(sum(primary_key_bytes_in_memory)) as primary_keys_size
from system.parts
where active
group by database, table
order by bytes_size desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment