我正在使用带有 CQL3 的 cassandra 1.2。我的键空间中有三个列族。当我查询其中一个列族(电话)时,需要很长时间才能检索。这是我的查询
**select * from phones where phone_no in ('9038487582');**
这是查询的跟踪输出。
activity | timestamp | source | source_elapsed
-------------------------------------------------+--------------+-------------+----------------
execute_cql3_query | 16:35:47,675 | 10.1.26.155 | 0
Parsing statement | 16:35:47,675 | 10.1.26.155 | 58
Peparing statement | 16:35:47,675 | 10.1.26.155 | 335
Executing single-partition query on phones | 16:35:47,676 | 10.1.26.155 | 1069
Acquiring sstable references | 16:35:47,676 | 10.1.26.155 | 1097
Merging memtable contents | 16:35:47,676 | 10.1.26.155 | 1143
Partition index lookup complete for sstable 822 | 16:35:47,676 | 10.1.26.155 | 1376
Partition index lookup complete for sstable 533 | 16:35:47,686 | 10.1.26.155 | 10659
Merging data from memtables and 2 sstables | 16:35:47,704 | 10.1.26.155 | 29192
Read 1 live cells and 0 tombstoned | 16:35:47,704 | 10.1.26.155 | 29332
Request complete | 16:35:47,704 | 10.1.26.155 | 29601
我在键空间上只有 1 个复制因子。并拥有 3 个节点集群。电话有大约 4000 万行,每行只有两列。它在 29 毫秒、15 毫秒、8 毫秒、5 毫秒、3 毫秒内返回,但并不一致。你们能就我可能犯的错误给我任何建议吗?此外,我的用例缓存命中率极低,因此缓存密钥对我来说不是解决方案。另外,这是我的列族定义。
CREATE TABLE phones (
phone_no text PRIMARY KEY,
ypids set<int>
) WITH
bloom_filter_fp_chance=0.100000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'LeveledCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};