官术网_书友最值得收藏!

Composite partition key with multiple clustering columns

It is also possible to declare a table that has both a composite partition key as well as multiple clustering columns. Suppose we wish to model a status update replies table to be clustered by the reply date first and then the reply time; we would have a table like this:

CREATE TABLE "status_update_replies" ( 
"status_update_username" text,
"status_update_id" timeuuid,
"status_date" date,
"status_time" time,
"id" timeuuid,
"author_username" text,
"body" text,
PRIMARY KEY (
("status_update_username", "status_update_id"),
"status_date", "status_time", "id"
)
);

In the preceding table, the partition key is a combination of status_update_username and status_update_id.

The replies are clustered by status_date, status_time and id.

主站蜘蛛池模板: 扎兰屯市| 江达县| 宜丰县| 周口市| 竹溪县| 卢湾区| 屏东市| 岳阳县| 岱山县| 哈密市| 云龙县| 望城县| 乌鲁木齐县| 陆丰市| 天镇县| 措勤县| 包头市| 开平市| 比如县| 正定县| 双城市| 安徽省| 阳东县| 冷水江市| 错那县| 庆元县| 大名县| 中超| 松桃| 营山县| 汉寿县| 双峰县| 德惠市| 中超| 石渠县| 田林县| 苍梧县| 临漳县| 汕头市| 芮城县| 徐汇区|