---
title: "Clone massive tables instantly and experiment safely in ClickHouse"
description: "ClickHouse's `CREATE TABLE ... CLONE AS` creates a full, independent copy of a table almost instantly, without copying any data."
url: "https://swe.quest/articles/clone-massive-tables-instantly-and-experiment-safely-in-clickhouse-98995e4944ae2cbf"
canonical: "https://clickhouse.com/blog/table-cloning"
source: "ClickHouse"
published: "2026-02-24"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 8
tags: ["storage-engines","analytics","databases","testing"]
---

# Clone massive tables instantly and experiment safely in ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-02-24, 8 min read, Deep dive. Original: [https://clickhouse.com/blog/table-cloning](https://clickhouse.com/blog/table-cloning)

## Summary

ClickHouse's \`CREATE TABLE ... CLONE AS\` creates a full, independent copy of a table almost instantly, without copying any data. It can do this because MergeTree data parts are immutable. Each part directory in the clone hard-links to the source's files, using POSIX hard links locally or metadata indirection on S3. Any later insert, update, delete or merge writes new parts, which gives part-level copy-on-write. Cloning time grows with part count rather than data size, the clone uses almost no extra storage until either table diverges, and shared files stay on disk until nothing references them. That makes clones safe for destructive tests, schema experiments, backfills and migrations.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)

## Prerequisites

- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- filesystem hard links ([easy posts on Storage systems](https://swe.quest/tags/storage-systems.md?difficulty=easy))

## Keywords

ClickHouse, MergeTree, CLONE AS, copy-on-write, ClickHouse Cloud

## Related posts

- [ClickHouse Release 24.10](https://swe.quest/articles/clickhouse-release-24-10-7f9e82db64624418.md): ClickHouse · 2024-11-06 · Medium · 14 min read · Analytics & OLAP, Databases, Caching
  ClickHouse 24.10 adds a \`--copy\` mode and an \`--implicit-select\` calculator mode to clickhouse-local, a CLONE AS clause, real-time query metrics in the client, and a filesystem cache for S3 and Azure files.
- [ClickHouse Cloud boosts performance with SharedMergeTree and Lightweight Updates](https://swe.quest/articles/clickhouse-cloud-boosts-performance-with-sharedmergetree-and-lightweight-updates-60af5576ecb3ec04.md): ClickHouse · 2023-08-17 · Medium · 24 min read · Storage engines, Replication, Analytics & OLAP, Cloud platforms, Scaling
  SharedMergeTree is a new ClickHouse Cloud table engine that replaces ReplicatedMergeTree (and its zero-copy replication variant) by moving both data and part metadata off the servers into shared object storage and ClickHouse Keeper.
- [ClickHouse and dbt - A Gift from the Community](https://swe.quest/articles/clickhouse-and-dbt-a-gift-from-the-community-edc7ddee62ee1cfc.md): ClickHouse · 2023-02-01 · Medium · 7 min read · Analytics & OLAP, Data pipelines, Open source
  The dbt-clickhouse adapter, started by community contributor Dmitriy Sokolov and later taken over as a vendor-supported plugin, maps dbt's view, table, incremental and ephemeral materializations onto ClickHouse features.
- [Handling Updates and Deletes in ClickHouse](https://swe.quest/articles/handling-updates-and-deletes-in-clickhouse-197a09a41f4d2486.md): ClickHouse · 2023-03-10 · Medium · 13 min read · Analytics & OLAP, Databases, Storage engines, SQL
  ClickHouse offers several ways to modify mostly-immutable analytical data, each with different costs.
- [ClickHouse Cloud: Fast, Updatable Lookups with the Join Table Engine](https://swe.quest/articles/clickhouse-cloud-fast-updatable-lookups-with-the-join-table-engine-b50f6e80ec781fcd.md): ClickHouse · 2026-05-12 · Medium · 6 min read · Analytics & OLAP, Databases, SQL, Cloud platforms
  ClickHouse's Join table engine keeps a precomputed in-memory hash map for a fixed join strictness, type and key.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
