v.24.10New Feature
Support for Creating Cloned Tables with MergeTree in ClickHouse
Support creating a table with a query:CREATE TABLE ... CLONE AS .... It clones the source table's schema and then attaches all partitions to the newly created table. This feature is only supported with tables of theMergeTreefamily Closes #65015. #69091 (tuanpach).
Why it matters
This feature simplifies duplicating a MergeTree family table by copying its schema and attaching existing partitions to the new table without data copying. It speeds up table creation and saves storage by reusing parts, enhancing operational efficiency for large datasets.How to use it
Use theCREATE TABLE <new_table> CLONE AS <source_table> statement to create a new table that clones the schema and attaches partitions from an existing MergeTree table. This feature is only available for tables within the MergeTree family.