Skip to content

Instantly share code, notes, and snippets.

@redsquare
Created March 15, 2024 13:22
Show Gist options
  • Save redsquare/234fd57b0ed450c1ba40cb10e8f7374b to your computer and use it in GitHub Desktop.
Save redsquare/234fd57b0ed450c1ba40cb10e8f7374b to your computer and use it in GitHub Desktop.
clickhouse_parts.sql
SELECT
table,
partition_id,
count(name) AS parts,
formatReadableSize(sum(bytes_on_disk)) AS size
FROM system.parts
WHERE (table = 'qw_3_requests_quotes') AND active AND (toUInt32(partition_id) < 20231001)
GROUP BY
table,
partition_id
WITH TOTALS
ORDER BY
table ASC,
partition_id ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment