DateTieredCompactionStrategy是否使用组合键? [英] Does DateTieredCompactionStrategy work with composite keys?

查看:280
本文介绍了DateTieredCompactionStrategy是否使用组合键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apache Cassandra 2.1.2中的DateTieredCompactionStrategy。使用复合聚类键?

Does DateTieredCompactionStrategy in Apache Cassandra 2.1.2. work with a compound clustering key?

更具体地说,与此表一样,(timestamp,hash)组成一个复合聚集键:

More specifically, like with this table where (timestamp, hash) makes up a compound clustering key:

CREATE TABLE sensordata (
    timeblock int,
    timestamp timestamp,
    hash int,
    data blob,
    PRIMARY KEY (timeblock, timestamp, hash)
)

DateTieredCompactionStrategy适用于 PRIMARY KEY(timeblock,timestamp) - 但它也适用于 PRIMARY KEY(timeblock,timestamp,hash)

I believe, that the DateTieredCompactionStrategy would work for PRIMARY KEY (timeblock, timestamp) -- but does it also work for PRIMARY KEY (timeblock, timestamp, hash) ?

推荐答案

DTCS将在压缩期间合并类似的年龄表。它真的不在乎你的PK。由于您的示例的所有行仍将按时间戳聚类,因此您应该很好。

The DTCS will just merge similar aged tables during compaction. It doesn't really care about your PK. As all rows for your example will still be clustered by timestamp, you should be fine.

这篇关于DateTieredCompactionStrategy是否使用组合键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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