Cassandra:什么是子列

发布于 2024-11-14 18:06:45 字数 759 浏览 1 评论 0原文

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

引用: Cassandra 有两级索引:键索引和列索引。但在超级列族中还有第三级子列;这些没有索引,并且对子列的任何请求都会反序列化该超级列中的所有子列。因此,您希望避免需要大量子列的数据模型。

=> 子列到底是什么?有趣的是,谷歌搜索这个词并没有真正产生结果。我知道超列的概念,但不太清楚术语“子列”到底指什么(如何定义):

什么概念是正确的?

第一:

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

第二:

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

此外,定义中的内容是什么:

comparator = UTF8Type and
subcomparator = UTF8Type and 

这只是定义的问题。

谢谢 马库斯

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

听风吹 2024-11-21 18:06:45

标准列的父级是其行。子列的父列是其超级列。除此之外,它们是相同的 - 只是有一个额外的嵌套级别,尽管正如您提到的那样对索引和检索有影响。

更多信息请访问 http://wiki.apache.org/cassandra/DataModelhttp://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      ...

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      ...
转身泪倾城 2024-11-21 18:06:45

comparator 值指示列在查询中返回给您时将如何排序。相同的概念适用于子比较器,但适用于超级列。

UTF8Type 指的是字符的 Unicode 标准。

  • 资料来源:《卡桑德拉权威指南》。

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".
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文