You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Adam Venturella <av...@gmail.com> on 2012/12/21 14:53:24 UTC

CQL3 Compound Primary Keys - Do I have the right idea?

Trying to better grasp compound primary keys and what they are conceptually
doing under the hood. When you create a table with a compound primary key
in cql3 (http://www.datastax.com/dev/blog/schema-in-cassandra-1-1) the
first part of the key is the partition key. I get that and the subsequent
parts help with the row name as I understand it.

So when you add a new row to that columnfamily/table, you are still adding
a row. In other words, the RandomPartitioner places it somewhere in the
cluster as a row on it's own as opposed to just adding a new column to an
existing row, which would live on the same node as the row

The effect of the compound key means that those rows are effectively
treated as if they were part of the same column, making it a wide column.

Is that the right idea or do I have the row / rp thing wrong?