Does DateTieredCompactionStrategy work with composite keys?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 07:18:58

问题


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

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

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


回答1:


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.



来源:https://stackoverflow.com/questions/28827489/does-datetieredcompactionstrategy-work-with-composite-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!