Forked from sanchezzzhak/clickhouse-get-tables-size.sql
Created
June 30, 2020 07:09
-
-
Save kymtwyf/557cc46c576636caa778f88c9066ed38 to your computer and use it in GitHub Desktop.
clickhouse get tables size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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