我是卡桑德拉的新手。我有一个带有复合主键的表。表的描述是
CREATE TABLE testtable (
foid bigint,
id bigint,
severity int,
category int,
ack boolean,
PRIMARY KEY (foid, id, severity, category)
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
index_interval=128 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
default_time_to_live=0 AND
speculative_retry='NONE' AND
memtable_flush_period_in_ms=0 AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'LZ4Compressor'};
我的要求是我需要foid
使用条件和id
范围条件以及severity
条件来查询表
所以当我尝试以下查询时
select * from testtable where foid in (5,6) and id>10 and severity in (5);
我收到错误消息
select * from testtable where foid in (5,6) and id>10 and severity in (5);
甚至severity
列上的相等条件对我来说就足够了,但这也行不通。
有什么方法可以实现相同的
我也尝试过使用二级索引,但这severity
并category
没有给我带来任何积极的影响。