cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Data model question - column names sort
Date Mon, 19 Apr 2010 20:16:22 GMT
On Thu, Apr 15, 2010 at 6:01 PM, Sonny Heer <sonnyheer@gmail.com> wrote:
> Need a way to have two different types of indexes.
>
> Key: aTextKey
> ColumnName: aTextColumnName:55
> Value: ""
>
> Key: aTextKey
> ColumnName: 55:aTextColumnName
> Value: ""
>
> All the valuable information is stored in the column name itself.
> Above two can be in different column families...
>
> Queries:
> Given a key, page me a list of numerical values sorted on aTextColumnName
> Given a key, page me a list of text values sorted on a numerical value
>
> This approach would require left padding the numeric value for the
> second index so cassandra can sort on column names correctly.

Don't do that, pack the numeric value into a fixed-length byte array
instead.  Then you don't have to do any expensive string operations in
the comparator.

-Jonathan

Mime
View raw message