卡桑德拉:什么是子列 [英] Cassandra: What is a subcolumn

查看:132
本文介绍了卡桑德拉:什么是子列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://wiki.apache.org/cassandra/Cas​​sandraLimitations

报价:Cassandra具有两个级别的索引:键和列.但是在超级列族中,存在第三级子列.这些没有被索引,并且任何对子列的请求都会反序列化该超列中的所有子列.因此,您要避免需要大量子列的数据模型.

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):

什么概念是正确的?

第一:

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

OR

第二:

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

此外,定义是什么?

comparator = UTF8Type and
subcomparator = UTF8Type and 

这只是定义问题.

谢谢马库斯

推荐答案

标准列的父级为其行.子列的父级是它的超列.除此之外,它们是相同的-尽管您提到了索引和检索的含义,但嵌套又增加了一个层次.

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.

更多信息,请参见 http://wiki.apache.org/cassandra/DataModel http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model

常规列系列:

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

超级列族:

row
      supercol                      supercol                     ...
          (sub)col  (sub)col  ...       (sub)col  (sub)col  ...
           val       val      ...        val       val      ...

这篇关于卡桑德拉:什么是子列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆