You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by mcasandra <mo...@gmail.com> on 2011/02/12 20:52:17 UTC

Partioning and Sorting is it CF Key or Column Key?

public class ColumnFamily {
Byte[] name;

  // The key is a user generated key
  Map<Byte[] /* key */,

    // The key is equal to the name of the Column.
    Map<Byte[] /* key */, Column>> value = null;
}
Some questions I have:

1) Is partitioning based on CF.KEY or KEY of Column? From what I read it's
based on column keys and not the CF keys but want to confirm.
2) When data is entered is it sorted based on CF.KEY or KEY of column or
both?
3) Looking at examples of indexing it looks like indexes are on columns.
Would it make sense to have index on CF.KEY also?
-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/Partioning-and-Sorting-is-it-CF-Key-or-Column-Key-tp6019450p6019450.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: Partioning and Sorting is it CF Key or Column Key?

Posted by Peter Schuller <pe...@infidyne.com>.
> Some questions I have:

Answering two of them independently of your Java snippet; not sure
what you intend to be read into it.

> 1) Is partitioning based on CF.KEY or KEY of Column? From what I read it's
> based on column keys and not the CF keys but want to confirm.

Partitioning is based on row key.

> 2) When data is entered is it sorted based on CF.KEY or KEY of column or
> both?

It is always sorted on column name as per the settings of the column
family. It may be sorted on row key if the OrderPreservingPartitioner
is used, but usually one uses the RandomPartitioner in which case it
will not be sorted on key (it will be sorted on ring token).

--
/ Peter Schuller