0
0
Snowflakecloud~10 mins

Why data sharing eliminates data copies in Snowflake - Visual Breakdown

Choose your learning style9 modes available
Process Flow - Why data sharing eliminates data copies
Data Provider Creates Share
Share Contains Reference to Data
Consumer Accesses Shared Data
No Data Copy Made
Consumer Queries Data Directly
Data Provider Maintains Single Source
Data sharing works by creating a reference to the original data, so consumers access the same data without making copies.
Execution Sample
Snowflake
CREATE SHARE my_share;
GRANT USAGE ON DATABASE my_db TO SHARE my_share;
-- Consumer: SHOW SHARES LIKE 'my_share';
This code creates a share and grants access to a database without copying data.
Process Table
StepActionData Copy Created?Result
1Provider creates share objectNoShare references original data
2Provider grants USAGE on database to shareNoShare can access data
3Consumer uses the shareNoConsumer sees data via reference
4Consumer queries dataNoData read directly from provider's storage
5Provider updates dataNoConsumer sees updated data immediately
6Consumer disconnectsNoNo data copies remain
💡 No data copies are made because sharing uses references, not duplication.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
Share ObjectNoneCreatedGranted AccessUsed by ConsumerActive ReferenceExists
Data CopyNoneNoneNoneNoneNoneNone
Consumer AccessNoneNoneNoneConnectedQueryingDisconnected
Key Moments - 3 Insights
Why doesn't the consumer get a separate copy of the data?
Because the share only contains a reference to the provider's data, no duplication happens (see execution_table steps 1-4).
What happens if the provider updates the data after sharing?
The consumer sees the updated data immediately since they access the same source (see execution_table step 5).
Does disconnecting the consumer remove the shared data?
No, the share object and data remain with the provider; only the consumer's access ends (see execution_table step 6).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step does the consumer start querying data?
AStep 4
BStep 2
CStep 3
DStep 5
💡 Hint
Check the 'Action' and 'Result' columns in execution_table rows for when querying starts.
According to variable_tracker, what is the state of 'Data Copy' after step 4?
APending
BCreated
CNone
DDeleted
💡 Hint
Look at the 'Data Copy' row under 'After Step 4' in variable_tracker.
If the provider updates data, what does the consumer see according to the execution_table?
AOld data until consumer reconnects
BUpdated data immediately
CNo data until share is recreated
DA copy of updated data
💡 Hint
Refer to execution_table step 5 'Result' column.
Concept Snapshot
Data sharing creates a reference, not a copy.
Provider creates a share and grants access.
Consumer queries data directly from provider storage.
Updates by provider reflect immediately.
No extra storage used for copies.
Full Transcript
Data sharing in Snowflake works by creating a share object that references existing data. The provider creates the share and grants USAGE on the database. The consumer then uses this share to query data directly without any data copy being made. This means the consumer always sees the latest data as maintained by the provider. When the consumer disconnects, no copies remain because none were created. This efficient method saves storage and keeps data consistent.