Snowflake · Beginner
What is zero-copy cloning in Snowflake?
By Anurag Pandey, Lead Data Engineer ·
The short answer
CREATE ... CLONE makes a new table, schema or database that points at the same micro-partitions as the source, so it is created quickly and costs no extra storage until either side changes data.
Opens this question on SpinTheMic. Start without signing up; sign in free for an AI report card.
Say it like this
About 50 seconds out loud. Use it as a model, then put it in your own words.
Zero-copy cloning lets me copy a table, a schema or a whole database with one CREATE ... CLONE statement, and it finishes quickly even for large tables. That's because Snowflake doesn't copy any data. The clone is new metadata that points at the same micro-partitions as the source. From then on the two objects are independent. If I update rows in the clone, Snowflake writes new micro-partitions only for the changed data, and only those add storage cost. I use it to give a developer a full copy of production to test against, or to take a quick backup before a risky change. I can also combine it with Time Travel and clone a table as it was an hour ago.
What interviewers look for
- You explain why it is fast: only metadata is created, data is shared.
- You know storage cost starts only for data changed after the clone.
- You give a practical use, such as dev environments or a backup before a release.
Common mistakes
- Saying the clone stays in sync with the source. After cloning, the two are independent.
- Saying clones are always free. Changed data in either object is stored and billed.
- Forgetting privileges. A clone does not keep the grants on the source object itself, unless you clone a table with COPY GRANTS.
Follow-up questions to expect
- 1How would you clone a table as it was yesterday?
- 2What happens to storage costs after you update half the rows of a clone?
- 3How is a clone different from a Time Travel query?
Opens this question on SpinTheMic. Start without signing up; sign in free for an AI report card.