Skip to content

Instantly share code, notes, and snippets.

@redsquare
Last active March 15, 2024 13:24
Show Gist options
  • Save redsquare/09b4f882c83bbced00ba57b258c4f0e8 to your computer and use it in GitHub Desktop.
Save redsquare/09b4f882c83bbced00ba57b258c4f0e8 to your computer and use it in GitHub Desktop.
clickhouse parts query
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