2010/12/6 魏金仙 <sei_...@126.com>: > so when will index files be in the memory?
The index files are never fully in memory (because it would quickly be too big). Hence, only a sample of this file is in memory (1 every 128 entry by default). When cassandra needs to know where a (row) key is on disk (for a given SStable), it checks this sample (an offset in the index file to a block of key location), reads the block of (128) entries corresponding in the index file on disk, thus finding the actual offset in the sstable where the corresponding row start. The goal of the KeyCache is to avoid this on a cache hit (thus basically avoiding a seek). > > At 2010-12-06 00:54:48,"Brandon Williams" <dri...@gmail.com> wrote: > > 2010/12/5 魏金仙 <sei_...@126.com> >> >> for each sstable, there is an index file, which is loaded in memory to >> locate a particular key's offset efficiently. > > Index files are not held in memory. > >> >> and for each CF, KeysCached can be set to cache keys' location. >> could you pls tell me the difference between the two? > > KeysCached are held in memory. > >> >> I'm wondering whether it's necessary to set "KeysCached" for a CF or not. > > Not necessary, but advantageous. > -Brandon > > ________________________________ > 网易163/126邮箱百分百兼容iphone ipad邮件收发