From fffb090860131dbb9b549863e9fc8476259331f9 Mon Sep 17 00:00:00 2001 From: Doug Tidwell Date: Thu, 5 Mar 2026 14:34:20 -0500 Subject: [PATCH] Added Diego's notes on DROP DETACHED to the "How ALTERs work in ClickHouse" page --- content/en/altinity-kb-setup-and-maintenance/alters.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/content/en/altinity-kb-setup-and-maintenance/alters.md b/content/en/altinity-kb-setup-and-maintenance/alters.md index 85f8b90627..bd7d72919d 100644 --- a/content/en/altinity-kb-setup-and-maintenance/alters.md +++ b/content/en/altinity-kb-setup-and-maintenance/alters.md @@ -109,6 +109,16 @@ Will trigger mutation, which will materialize this column. Lightweight, it's only about changing of table metadata and removing corresponding files from filesystem. For Compact parts it will trigger merge, which can be heavy. [issue](https://github.com/ClickHouse/ClickHouse/issues/27502) +#### DROP DETACHED command +The DROP DETACHED command in ClickHouse® is used to remove parts or partitions that have previously been detached (i.e., moved to the detached directory and forgotten by the server). The syntax is: + +{{% alert title="Warning" color="warning" %}} +Be careful before dropping any detached part or partition. Validate that data is no longer needed and keep a backup before running destructive commands. +{{% /alert %}} + +```sql +ALTER TABLE table_name [ON CLUSTER cluster] DROP DETACHED PARTITION|PART ALL|partition_expr +``` #### MODIFY COLUMN (DATE TYPE)