You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Paul Prescod <pa...@prescod.net> on 2010/04/14 02:04:24 UTC

Caching is a full row?

Am I correct in my understanding that the unit of caching (and
fetching from disk?) is a full row?

                cf = cacheRow(filter.key);

Also, that the thing that is cached is just the top level columns?

            cached = getTopLevelColumns(new IdentityQueryFilter(key,
new QueryPath(columnFamily_)), Integer.MIN_VALUE);

 Paul Prescod

Re: Caching is a full row?

Posted by Sylvain Lebresne <sy...@yakaz.com>.
Yes, it will put the whole row in cache even if you read only a bunch
of columns.
It means in particular that with row cache, every time you read a row,
the full row
will be read on a cache miss. Thus it may hurts you read badly in some scenario
(typically with big rows) instead of helping them. Enable row cache wisely :)

--
Sylvain

On Wed, Apr 14, 2010 at 3:06 AM, Paul Prescod <pr...@gmail.com> wrote:
> On Tue, Apr 13, 2010 at 5:26 PM, Rob Coli <rc...@digg.com> wrote:
>> On 4/13/10 5:04 PM, Paul Prescod wrote:
>>>
>>> Am I correct in my understanding that the unit of caching (and
>>> fetching from disk?) is a full row?
>>
>> Cassandra has both a Key and a Row cache. Unfortunately there appears to be
>> no current wiki doc describing them. If you are looking into the topic, wiki
>> updates are always appreciated. :)
>
> Yeah, sorry I knew that but I was asking specifically about if there
> was any caching within a row that is more granular than the whole row.
> It looks to me like it doesn't just cache the columns you asked for,
> but all columns in the row. This obviously has some interesting
> implications for keys that are large "indexes" in a single row.
>
>  Paul Prescod
>

Re: Caching is a full row?

Posted by Paul Prescod <pr...@gmail.com>.
On Tue, Apr 13, 2010 at 5:26 PM, Rob Coli <rc...@digg.com> wrote:
> On 4/13/10 5:04 PM, Paul Prescod wrote:
>>
>> Am I correct in my understanding that the unit of caching (and
>> fetching from disk?) is a full row?
>
> Cassandra has both a Key and a Row cache. Unfortunately there appears to be
> no current wiki doc describing them. If you are looking into the topic, wiki
> updates are always appreciated. :)

Yeah, sorry I knew that but I was asking specifically about if there
was any caching within a row that is more granular than the whole row.
It looks to me like it doesn't just cache the columns you asked for,
but all columns in the row. This obviously has some interesting
implications for keys that are large "indexes" in a single row.

 Paul Prescod

Re: Caching is a full row?

Posted by Rob Coli <rc...@digg.com>.
On 4/13/10 5:04 PM, Paul Prescod wrote:
> Am I correct in my understanding that the unit of caching (and
> fetching from disk?) is a full row?

Cassandra has both a Key and a Row cache. Unfortunately there appears to 
be no current wiki doc describing them. If you are looking into the 
topic, wiki updates are always appreciated. :)

=Rob