What happens to the underlying table data when a CLUSTER BY clause is added to a Snowflake table?
When aCLUSTER BYclause is added to a Snowflake table, it specifies one or more columns to organize the data within the table's micro-partitions. This clustering aims to colocate data with similar values in the same or adjacent micro-partitions. By doing so, it enhances the efficiency of query pruning, where the Snowflake query optimizer can skip over irrelevant micro-partitions that do not contain the data relevant to the query, thereby improving performance.
References:
Snowflake Documentation on Clustering Keys & Clustered Tables1.
Community discussions on how source data's ordering affects a table with a cluster key
Lenna
6 months agoGlenn
7 months agoNoe
7 months agoLili
7 months agoCeleste
8 months agoFausto
8 months agoRyan
8 months agoKiley
8 months agoBilly
8 months agoPearlie
9 months agoKarl
9 months agoDanica
9 months agoEmeline
9 months agoOzell
9 months agoTawna
10 months agoBrandee
10 months agoEdgar
10 months agoQuinn
6 months agoElli
6 months agoLeota
7 months agoCordelia
7 months agoBettye
11 months agoVincenza
11 months ago