diff options
| author | alex <alex@pdp7.net> | 2024-01-23 22:38:36 +0100 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2024-01-23 22:38:36 +0100 |
| commit | 71cc54e1abe890f8b57886d84dcc03f30289e53b (patch) | |
| tree | c59ae186d56407fbb9fdd80d082a98cc4f7e4127 | |
| parent | cd8431eb4da5040433f11b678dd0d6075d6e674b (diff) | |
Add clickhouse_maintenance
| -rw-r--r-- | personal_infra/clickhouse_maintenance.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/personal_infra/clickhouse_maintenance.md b/personal_infra/clickhouse_maintenance.md new file mode 100644 index 00000000..e8d3e71f --- /dev/null +++ b/personal_infra/clickhouse_maintenance.md @@ -0,0 +1,15 @@ +``` +$ ssh clickhouse... +$ clickhouse-client +$ use system; +$ SELECT + table, + formatReadableSize(sum(bytes)) AS size, + min(min_date) AS min_date, + max(max_date) AS max_date +FROM system.parts +WHERE active +GROUP BY table +ORDER BY sum(bytes) ASC +$ truncate table ... +``` |
