Database Reference
In-Depth Information
There are a couple of reasons for which you might want to specify an explicit clustering
order at table creation time. First, reversing the clustering order at query time has a slight
performance penalty—you don't need to avoid it but all things being equal, it's best to cre-
ate the table with the clustering order corresponding to your most frequent access pattern.
In the case of status updates, our second table with the reversed clustering order is better,
since in most cases we'll want to see the newest status updates first.
Second, if you have multiple clustering columns, you might want to order by a mixture of
ascending and descending columns. For instance, you might want to store a list of
products in ascending order by manufacturer name, and then in a descending order by the
date on which the product was added within each manufacturer. In this case, you would
need to set the CLUSTERING ORDER at table creation time, since ORDER BY does not
allow you to reverse the clustering order of one column without reversing the order of all
columns.
Search WWH ::




Custom Search