On Thu, Apr 15, 2010 at 6:01 PM, Sonny Heer <sonnyh...@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