You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Mark <st...@gmail.com> on 2010/08/13 18:47:47 UTC

Key Index/Key Slices

Keys are indexed in Cassandra but are they ordered? If so, how?

Do Key Slices work like Range Slices for columns.. ie I can give a start 
and end range? It seems like if they are not ordered (which I think is 
true) then performing KeyRanges would be somewhat inefficient or at 
least not as efficient as a slicing across columns. Is the case?

ColumnFamilyFoo: {
   "a" : {},
   "b" : {},
   "c" : {}
}

ColumnFamilyBar: {
    "all" : {
       "a" : --
       "b" : --
       "c" : --
    }
}

Is doing a KeySlice "a" through "c" on ColumnFamilyFoo pretty much the 
same thing as doing a RangeSlice "a" through "c" on ColumnFamilyBar on 
key "all"?

Thanks for the explanation

Re: Key Index/Key Slices

Posted by Jonathan Ellis <jb...@gmail.com>.
ranges are always in token order.  this is why ranges with a start and
end are only useful with OrderPreservingPartioner, where token order
is defined to be key order.

On Fri, Aug 13, 2010 at 11:47 AM, Mark <st...@gmail.com> wrote:
> Keys are indexed in Cassandra but are they ordered? If so, how?
>
> Do Key Slices work like Range Slices for columns.. ie I can give a start and
> end range? It seems like if they are not ordered (which I think is true)
> then performing KeyRanges would be somewhat inefficient or at least not as
> efficient as a slicing across columns. Is the case?
>
> ColumnFamilyFoo: {
>  "a" : {},
>  "b" : {},
>  "c" : {}
> }
>
> ColumnFamilyBar: {
>   "all" : {
>      "a" : --
>      "b" : --
>      "c" : --
>   }
> }
>
> Is doing a KeySlice "a" through "c" on ColumnFamilyFoo pretty much the same
> thing as doing a RangeSlice "a" through "c" on ColumnFamilyBar on key "all"?
>
> Thanks for the explanation
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com