You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by 魏金仙 <se...@126.com> on 2010/12/05 14:34:11 UTC

index file and KeysCached

for each sstable, there is an index file, which is loaded in memory to locate a particular key's offset efficiently.
and for each CF, KeysCached can be set to cache keys' location.
could you pls tell me the difference between the two?
I'm wondering whether it's necessary to set "KeysCached" for a CF or not.
Thanks for your time.

Re: Re: index file and KeysCached

Posted by Sylvain Lebresne <sy...@yakaz.com>.
2010/12/6 魏金仙 <se...@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" <dr...@gmail.com> wrote:
>
> 2010/12/5 魏金仙 <se...@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邮件收发

Re:Re: index file and KeysCached

Posted by 魏金仙 <se...@126.com>.
so when will index files be in the memory?


At 2010-12-06 00:54:48,"Brandon Williams" <dr...@gmail.com> wrote:

2010/12/5 魏金仙<se...@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

Re: index file and KeysCached

Posted by Brandon Williams <dr...@gmail.com>.
2010/12/5 魏金仙 <se...@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