Database Reference
In-Depth Information
Efficient result ordering
It's quite common to want to retrieve a record set ordered by a particular field; for instance,
a photo sharing service will want to retrieve the most recent photographs in descending or-
der of creation. Since sorting data on the fly is a fundamentally expensive operation, data-
bases must keep information about record ordering persisted on disk in order to efficiently
return results in order. In a relational database, this is one of the jobs of a secondary index.
In Cassandra, secondary indexes can't be used for result ordering, but tables can be struc-
tured such that rows are always kept sorted by a given column or columns, called cluster-
ing columns . Sorting by arbitrary columns at read time is not possible, but the capacity to
efficiently order records in any way, and to retrieve ranges of records based on this order-
ing, is an unusually powerful capability for a distributed database.
Search WWH ::




Custom Search