You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Subroto Barua <sb...@yahoo.com.INVALID> on 2019/12/31 19:20:21 UTC

Question on large partition key

I have a table ---
create Table mytable (
Id text,

cdate timestamp,

Tk text,

Primary key (id, cdate)

) with clustering order by (cdate desc);

One of the partition key has 2,099,414 rows; using the following formula:

row_size = sum_of_all_columns_ size_within_row + partition_key_size
row_size = 32bytes (string) + 8 + 32 == 72 bytes
partition_size = row_ size_average * number_of_rows_in_this_partition
partition_size = 72 * 2099414 = 147,615 KB
Cassandra system log reports: 128,064,307 bytes for this key
Can someone explain the gap? Did I make any wrong assumption in calculating the row size/pk size?
C* version is 3.0.15
Thanks,
Subroto


Re: Question on large partition key

Posted by Jon Haddad <jo...@jonhaddad.com>.
I suggest checking out Aaron Morton's post on the 3.0 storage engine.

https://thelastpickle.com/blog/2016/03/04/introductiont-to-the-apache-cassandra-3-storage-engine.html

On Tue, Dec 31, 2019 at 11:20 AM Subroto Barua <sb...@yahoo.com.invalid>
wrote:

> I have a table ---
>
> create Table mytable (
>
> Id text,
>
> cdate timestamp,
>
> Tk text,
>
> Primary key (id, cdate)
>
> ) with clustering order by (cdate desc);
>
> One of the partition key has 2,099,414 rows; using the following formula:
>
> row_size = sum_of_all_columns_ size_within_row + partition_key_size
> row_size = 32bytes (string) + 8 + 32 == 72 bytes
>
> partition_size = row_ size_average * number_of_rows_in_this_partition
> partition_size = 72 * 2099414 = 147,615 KB
>
> Cassandra system log reports: 128,064,307 bytes for this key
>
> Can someone explain the gap? Did I make any wrong assumption in
> calculating the row size/pk size?
>
> C* version is 3.0.15
>
> Thanks,
>
> Subroto
>
>