COF-C02 · Question #680
What happens to the underlying table data when a CLUSTER BY clause is added to a Snowflake table?
The correct answer is D. Data may be colocated by the cluster key within the micro-partitions to improve pruning. Adding a CLUSTER BY clause defines a clustering key but does not immediately reorganize data. Snowflake's Automatic Clustering service then progressively reorganizes micro-partitions over time so that rows with similar clustering key values are stored together (colocated)…
Question
What happens to the underlying table data when a CLUSTER BY clause is added to a Snowflake table?
Options
- AData is hashed by the cluster key to facilitate fast searches for common data values
- BLarger micro-partitions are created for common data values to reduce the number of partitions that
- CSmaller micro-partitions are created for common data values to allow for more parallelism
- DData may be colocated by the cluster key within the micro-partitions to improve pruning
How the community answered
(59 responses)- A2% (1)
- B3% (2)
- D95% (56)
Explanation
Adding a CLUSTER BY clause defines a clustering key but does not immediately reorganize data. Snowflake's Automatic Clustering service then progressively reorganizes micro-partitions over time so that rows with similar clustering key values are stored together (colocated) within the same or adjacent micro-partitions. This colocation significantly improves partition pruning - queries filtering on the cluster key can skip large numbers of irrelevant partitions. Data is not hashed (that would be a hash distribution model). Micro-partition sizes remain consistent; the goal is value colocation, not size adjustment.
Topics
Community Discussion
No community discussion yet for this question.