You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Cory Mintz <co...@gmail.com> on 2012/09/21 02:52:24 UTC

Should row keys be inserted in ascending order?

The DataModel page in the Cassandra Wiki (
http://wiki.apache.org/cassandra/DataModel) says:



"In Cassandra, each column family is stored in a separate file, and the
file is sorted in row (i.e. key) major order."



Does this mean that new row keys should be ascending? If they are not
ascending does that mean all

of the data after the new key needs to be shifted down?


Thanks.

Cory

Re: Should row keys be inserted in ascending order?

Posted by Tyler Hobbs <ty...@datastax.com>.
Rows are actually stored on disk in the order of the hash of their keys
when using RandomPartitioner.

Furthermore, the rows are stored in SSTables, which are immutable, and are
periodically compacted together.  There's no shifting involved.  This gives
an overview: http://wiki.apache.org/cassandra/MemtableSSTable

On Thu, Sep 20, 2012 at 7:52 PM, Cory Mintz <co...@gmail.com> wrote:

> The DataModel page in the Cassandra Wiki (
> http://wiki.apache.org/cassandra/DataModel) says:
>
>
>
> "In Cassandra, each column family is stored in a separate file, and the
> file is sorted in row (i.e. key) major order."
>
>
>
> Does this mean that new row keys should be ascending? If they are not
> ascending does that mean all
>
> of the data after the new key needs to be shifted down?
>
>
> Thanks.
>
> Cory
>



-- 
Tyler Hobbs
DataStax <http://datastax.com/>