0 votes
in Snowflake by
What do you mean by zero-copy cloning in Snowflake?

2 Answers

0 votes
by

Zero Copy cloning is a Snowflake feature that allows users to create a copy of a table, schema, or database without duplicating the underlying data. 

Captures a snapshot of the data in the source object and provides it to the clone object.

There is no additional cost for cloning as the same tier of storage is shared between source and clone.

Makes the clone writable and independent from the source and this prevents changes made to one object from being reflected in the other. 

0 votes
by

Zero-copy cloning is one of the great features of Snowflake. It basically allows you to duplicate the source object without making a physical copy of it or adding additional storage costs to it. A snapshot of the data in a source object is taken when a clone (cloned object) is created, and it is made available to the cloned object. Cloned objects are independent of the source object and are therefore writable, and any changes made to either object are not reflected in the other. The keyword CLONE allows you to copy tables, schemas, databases without actually copying any data. 

Zero copy cloning syntax in Snowflake

In order to clone an entire production database for development purposes:

CREATE DATABASE Dev CLONE Prod; 

In order to clone a schema

CREATE SCHEMA Dev.DataSchema1 CLONE Prod.DataSchema1; 

In order to clone a single table:

CREATE TABLE C CLONE Dev.public.C;

...