How to monitor how many storage (GB) is consumed b...
# general
ł
How to monitor how many storage (GB) is consumed by metrics, logs and/or traces?
s
This gives you the stats by database
Copy code
SELECT
    database,
    formatReadableSize(sum(data_compressed_bytes) AS size) AS compressed,
    formatReadableSize(sum(data_uncompressed_bytes) AS usize) AS uncompressed,
    round(usize / size, 2) AS compr_rate,
    sum(rows) AS rows,
    count() AS part_count
FROM system.parts
WHERE (active = 1) AND (database LIKE '%')
GROUP BY
    database
ORDER BY size DESC;