Will take a stab at the answers...

1) No, all updates to  the same key are consider the same row. 
2) Use the get_count Thrift API function, or 'count; in the cassandra-cli The counts is *not* accurate, as that would require locking the db to prevent updates while the pixies counted the rows. 
3) Yes, see http://wiki.apache.org/cassandra/FAQ#range_ghosts When using get_range_slices check the number of columns returned for each key against what you expected. It's getting the keys first, then for those returning the non-deleted columns that match your request.  
4) Just use get_count. 

Hope that helps
Aaron

On 20 Sep, 2010,at 05:21 AM, kannan chandrasekaran <ckannanck@yahoo.com> wrote:

Thanks again for the replies Jonathan.... Couple more clarifications....

1) Since the sstables are write-once only (append only), does cassandra count the updates to the same key as a separate row ..i.e does the row count include even the old/deleted data ?
2) If I need the count of the rows in a columnfamily whats the best way to get that information... Is it OK to use the capacity field in the MBean interface to get the rowcount for a given columnfamily assuming its exposed as a public API and keycache is set to "100%"  or  is this approach a bit too hacky ?
3) I read about get_range_slices...but it says "Unlike get_key_range, this applies the given predicate to all keys in the range, not just those with undeleted matching data. ".... Does that mean the api returns even obsolete data ? Please help me understand this.
4) If you were to use get_range_slices for the row count then the idea is to:
* Use the get_range_slices to fetch all data
* Count the rows at the client side
Correct me if I am wrong ...


Thanks
Kannan


From: Jonathan Ellis <jbellis@gmail.com>
To: user <user@cassandra.apache.org>
Sent: Sat, September 18, 2010 2:42:28 AM
Subject: Re: Cassandra Cache Mbean values; bytes or number of elements ?

elements.

it gets the capacity from your configuration setting. cassandra knows
how many rows you have, and you told it to cache all of them, so
that's what it set capacity to.

On Fri, Sep 17, 2010 at 8:58 PM, kannan chandrasekaran
<ckannanck@yahoo.com> wrote:
> I am using 0.6.5 and my keycache for the CF is set as "100%" ... What do the
> values in the Mbean interfaces indicate ?  bytes or number of elements ?
>
> Specifically, these are the numbers that I observe for one of the column
> family...
>
> capacity = 36826888 (if this is number of elements,  how does cassandra come
> up with this number ?)
> Size = 148834
>
> Please let me know.
> Thanks
> Kannan
>
>



--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com