Data engineering·Cost, layout and query performance
the table is partitioned by day and sorted within each day by customer, so filtering on a customer skips most blocks inside the partition.
Clustering key
Also calledcluster by, data clustering
The column data is physically ordered by within a partition, so per-block statistics become selective. It is the second-order layout decision after partitioning, and it is what makes filters on high-cardinality columns cheap without creating a folder per value. Ordering is not free: it is maintained by rewrite, so a clustered table needs periodic maintenance to stay clustered as data is appended.