問題文
Cleaned output will be queried almost always by a date range and occasionally by customer identifier. Which partition key is right?
選択肢
- The date, because the common access pattern then prunes whole directories, while the occasional identifier lookup can be served by reading the range and filtering.
- Both, with the identifier nested inside the date.
- The customer identifier, because it has the highest cardinality and a high-cardinality key produces the largest number of partitions, which gives the reader the finest possible granularity for pruning whichever of the two access patterns is used at query time.
- Neither; store one flat directory and rely on column statistics.