2

http://wiki.apache.org/cassandra/CassandraLimitations

Quote: Cassandra has two levels of indexes: key and column. But in super columnfamilies there is a third level of subcolumns; these are not indexed, and any request for a subcolumn deserializes all the subcolumns in that supercolumn. So you want to avoid a data model that requires large numbers of subcolumns.

=>What is exactly the subcolumn? It's interesting, googling the term does nor really yield in results. I know the concepts of supercolumn, but its not really clear what exactly the term "subcolumn" refers to (how it is defined):

What concept is correct?

First:

ROW-KEY
   SubCol     SubCol    
    col  col  col val
    val  val  col val

OR

Second:

ROW-KEY
   Column           Column
    SubCol SubCol   SubCol SubCol
    val    val      val    val

Furthermore, what is what in the Definitions:

comparator = UTF8Type and
subcomparator = UTF8Type and 

Its only a matter of definition.

Thanks Markus

Markus
  • 4,062
  • 4
  • 39
  • 42

2 Answers2

7

A standard column's parent is its row. A sub-column's parent is its supercolumn. Apart from that, they are the same - there's just an additional level of nesting, though there are implications for indexing and retrieval as you've mentioned.

More info at http://wiki.apache.org/cassandra/DataModel and http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model

Normal column family:

row
    col  col  col ...
    val  val  val ...

Super column family:

row
      supercol                      supercol                     ...
          (sub)col  (sub)col  ...       (sub)col  (sub)col  ...
           val       val      ...        val       val      ...
DNA
  • 42,007
  • 12
  • 107
  • 146
  • Thanks!. The first link I read already befor asking here, but your diagram is multiple times better in describing the terms! (on the cassandra website the yonley have these examples) but yours defines it absolutely clear. If your are from cassandra team, you could update this into the site. thanks. – Markus Jun 11 '11 at 11:25
  • 2
    "WTF is a supercolumn" ought to be put out of its misery. I'd recommend http://www.datastax.com/docs/0.8/data_model/index or Max's posts on data modeling (linked at the top of http://wiki.apache.org/cassandra/ArticlesAndPresentations). – jbellis Jun 16 '11 at 15:55
0

The comparator value indicates how columns will be sorted when they are returned to you in a query. The same concept applies to subcomparator, but for super columns.

UTF8Type refers to the Unicode standards for characters.

  • Source: "Cassandra the Definitive Guide".
Henry
  • 926
  • 2
  • 12
  • 27