Created
December 4, 2024 05:34
-
-
Save dynax60/a2ade74e1c65a27d4289020e7ccd4cee to your computer and use it in GitHub Desktop.
Clickhouse table sizes
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 table, formatReadableSize(size) as size, rows, days, formatReadableSize(avgDaySize) as avgDaySize FROM ( | |
SELECT | |
table, | |
sum(bytes) AS size, | |
sum(rows) AS rows, | |
min(min_date) AS min_date, | |
max(max_date) AS max_date, | |
(max_date - min_date) AS days, | |
size / (max_date - min_date) AS avgDaySize | |
FROM system.parts | |
WHERE active | |
GROUP BY table | |
ORDER BY rows DESC | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://kb.altinity.com/altinity-kb-setup-and-maintenance/altinity-kb-system-tables-eat-my-disk/