How does a cache key cache work when the same key exists in more than one sstables?

1) In accordance with the data warehouse key cache, the primary key index for the row is stored.

2) In our case, we have enough memory allocated for the key cache, and the same key is present in several sstables with different columns.

3) If there are no calls to access all these key keys from several sstables, then how are the indexes stored in the key cache? Will they store indexes for all sstables OR only for the last sstable with which the key was recently accessed?

+4
source share
1 answer

From doc

The key cache stores the location of the keys in memory on the family basis column.

The key cache serves as an index for the key in all sstables that it is present.

The cache cache is maintained as configured. Therefore, the cache key can save one search on disk in SSTable [minimum]. Each search for keys ends with a hit, at least in the color filter of all sstable. The success key cache is checked simply to skip the sstable index [pointers to the key example @ default interval 127].

Read the cassandra path as follows

Memtable → Row Cache (Off heap) → Bloom Filter → Key Cache → SSTable Index [when skipped] → Disk

Everything in bold means that they are stored in memory (in the heap or in the heap). Therefore, they do not stack with the disk

Each sstable must maintain its own key cache. Souce from slide no 101 and Source2 from slide no 23

Enabling miss in the key cache, the sstable index is used - this will give a key by which the 128th range can depend on the key. From now on, search for keys to start keys [can be from 1 to many].

I will update the answer again if I get any help on how the cassandra in size of the key cache of each sstable can be [key_cache_conf / no_of_sstables]?

+5
source

All Articles