incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wz1975 <wz1...@YAHOO.COM>
Subject RE: CQL3 Compound Primary Keys - Do I have the right idea?
Date Sat, 22 Dec 2012 08:36:37 GMT
You still add one row. The  column name is the remaining part of the composite key (repeat
for each column) plus each of the column which is not in the composite key. I found it is
much clearer to look at the data through Cassandra -cli which shows you how data is stored. 


Thanks.
-Wei

Sent from my Samsung smartphone on AT&T

-------- Original message --------
Subject: CQL3 Compound Primary Keys - Do I have the right idea? 
From: Adam Venturella <aventurella@gmail.com> 
To: user@cassandra.apache.org 
CC:  

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?
Mime
View raw message