CREATE TABLE messages ( room_id uuid, bucket_day date, ts bigint, msg_id uuid, uid text, content text, PRIMARY KEY ((room_id, bucket_day), ts, msg_id) ) WITH CLUSTERING ORDER BY (ts ASC);