我在一台相当强大的机器上运行Cassandra 3.3版本。我想尝试行缓存,所以我已经为行缓存分配了2 GB的RAM,并配置了目标表来缓存它们的行数。
如果我在一个非常小的表(小于1 MB)上运行查询两次跟踪,在第二个查询中我看到一个缓存命中。但是,当我在一个大表(34 GB)上运行查询时,我只得到缓存未命中并在每次缓存未命中后看到此消息:
Fetching data but not populating cache as query does not query from the start of the partition
这是什么意思?我是否需要更大的行缓存才能处理具有9000万个密钥的34 GB表?
看一下github上的行缓存源代码,我看到clusteringIndexFilter().isHeadFilter()
在这种情况下必须评估为false。这是我的分区太大了吗?
我的架构是:
CREATE TABLE ap.account (
email text PRIMARY KEY,
added_at timestamp,
data map< int, int >
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': '100000'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
查询只是SELECT * FROM account WHERE email='sample@test.com'