1
在這裏,我對 How do secondary indexes work in Cassandra?卡桑德拉CQL架構最佳實踐
CREATE TABLE update_audit (
scopeid bigint,
formid bigint,
time timestamp,
operation int,
record_id bigint,
ipaddress text,
user_id bigint,
value text,
PRIMARY KEY ((scopeid), formid, time)
) WITH CLUSTERING ORDER BY (formid ASC, time DESC)
僅供參考, 操作再次詢問類似的問題變得非常很好的解釋後列可能的值是1,2和3,低基數。
record_link_id高基數。每個條目都可以是唯一的。
user_id說明是根據How do secondary indexes work in Cassandra?和The sweet spot for cassandra secondary indexing.
搜索索引的最佳候選人應該工作基於
- 時間與限100
- 操作和時間限制爲100.
- user_id說明和時間與限100
- RECORD_ID和時間與限100
問題
總記錄多於萬兆
其中一個最好是 - 創建操作索引,user_id說明和RECORD_ID和應用限制100
1) Does Hidden columnfamily for index operation Will return only 100 results?
2) More seeks will slow down the fetch operation?
或創建一個新的ColumnFamily與像
CREATE TABLE audit_operation_idx (
scopeid bigint,
formid bigint,
operation int,
time timeuuid,
PRIMARY KEY ((scopeid), formid, operation, time)
) WITH CLUSTERING ORDER BY (formid ASC, operation ASC, time DESC)
required two select query for single select operation.
定義所以,如果我會爲操作創造新的ColumnFamily ,user_id and record_id
我必須做一個批量查詢插入這四個列家族。
3) Does TCP problems will come? while executing batch query.because writes will be huge.
4) what else should I cover to avoid unnecessary problems.