Zero Copy Cloning
Snowflake · Storage & Optimization
Theory
CREATE ... CLONE creates a copy of a table, schema or database in seconds without copying data. The clone is a new object whose metadata points to the same micro-partitions as the source. From then on the two are independent: when either one inserts, updates or deletes rows, new micro-partitions are written for that object only, and only those changed partitions add storage.
You can also clone from a point in the past with Time Travel, for example CREATE TABLE orders_before_fix CLONE orders AT(OFFSET => -3600). Cloning a database or schema clones the objects inside it, which makes it the standard way to create a dev or test copy of production.
Why we use it
Copying large tables the normal way takes time and doubles storage. Cloning gives teams full-size, isolated copies for testing, debugging or backups almost instantly and at almost no extra storage cost.
When to use it
Use clones for dev and test environments, safe experiments before risky changes, and point-in-time snapshots. Do not treat a clone as an off-site backup: it lives in the same account. Use replication for that.
How CLONE Works
Creates a full logical copy of a database, schema, or table in seconds by pointing the new object at the same underlying micro-partitions — no data is physically duplicated.
Why It's Essentially Free
A clone costs nothing extra in storage until it diverges from the source — once rows are added, changed, or deleted in either copy, only the changed data consumes new storage.
Common Use Cases
The standard way to spin up a dev or test copy of production data instantly, or to snapshot a table before running a risky migration so you can compare or roll back.
How it works
- Need a copy of orders for testing
- CREATE TABLE orders_dev CLONE orders
- Clone shares the source's micro-partitions; no data copied
- Is the clone or source modified? Yes: New partitions are written for that object only. No: Both keep sharing storage.
- Drop the clone when done; shared data stays with the source
Example
CREATE TABLE orders_backup CLONE orders;
CREATE SCHEMA dev_schema CLONE learn;
CREATE DATABASE test_db CLONE practice_db;
CREATE TABLE orders_before_migration CLONE orders AT(OFFSET => -86400);
UPDATE orders_backup SET amount = 0 WHERE order_id = 1;
-- The original 'orders' table is unaffected
SELECT TABLE_NAME, ACTIVE_BYTES, TIME_TRAVEL_BYTES, RETAINED_FOR_CLONE_BYTES
FROM INFORMATION_SCHEMA.TABLE_STORAGE_METRICS;Key points
- New storage is consumed only when cloned data diverges
- Works on databases, schemas and individual tables
- Combine with AT/BEFORE to clone a past state
- A clone does not inherit the source's Time Travel history
- Ideal for spinning up dev/test environments instantly