How to determine disk usage for specific table

2,358 views
Skip to first unread message

Ivan Serikov

unread,
Oct 10, 2017, 5:04:23 AM10/10/17
to ClickHouse
HI everyone
I'm compare several variants of table
- one with String field
- another with Enum field

I filled both tables with sample data with about several millions rows
How can I determine disk usage for each table ?

Владимир К.

unread,
Oct 13, 2017, 3:28:13 AM10/13/17
to ClickHouse
Экспериментирую в рамках одной машины, в таком случае вроде работает следующий способ - перехожу в каталог /var/lib/clickhouse/data/имя_базы/имя таблицы и дальше смотрю командой du -hs

вторник, 10 октября 2017 г., 14:04:23 UTC+5 пользователь Ivan Serikov написал:

Николай Кочетов

unread,
Oct 13, 2017, 12:09:18 PM10/13/17
to ClickHouse
You can use
select sum(marks_size) + sum(bytes) from system.parts limit where database = 'database_name' and table = 'table_name' and active

du command for /var/lib/clickhouse/data/database_name/table_name is also ok.

вторник, 10 октября 2017 г., 12:04:23 UTC+3 пользователь Ivan Serikov написал:

Mikhail Filimonov

unread,
Oct 20, 2017, 6:36:49 AM10/20/17
to ClickHouse
Try that:

select name, formatReadableSize(sum(data_compressed_bytes)) as compressed, formatReadableSize(sum(data_uncompressed_bytes)) as uncompressed, sum(data_compressed_bytes)*100/sum(data_uncompressed_bytes) as compress_ratio from system.columns where table = 'XXXX' group by name with totals order by sum(data_compressed_bytes);

You can even add both columns at the same time and compare their sizes (both compressed and uncompressed).

Ivan Serikov

unread,
Oct 23, 2017, 6:25:34 AM10/23/17
to ClickHouse
Thanks a lot Michael.
Results are very similar to real
Reply all
Reply to author
Forward
0 new messages