Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the same partition key in different cassandra tables add up to cell theoretical limit?

Tags:

cassandra

It is known that a Cassandra partition has a theoretical limit of 2 billion cells. But how does that work in a situation like this one below:

create table table1 (
    some_id int PRIMARY KEY,
    some_name text
);

create table table2 (
    other_id int PRIMARY KEY,
    other_name text
);

Assume we have 1 billion cells in partition (some_id = 1) on table1. If we had another 1 billion cells in partition (other_id = 1) on table2, would those add up to the 2 billion theoretical limit?

In other words, are equal partition keys in different tables stored together?

like image 616
L. Sandes Avatar asked Apr 18 '16 17:04

L. Sandes


1 Answers

Different tables have different partitions. This makes the structure of any particular partition homogenous (it will always follow the proscribed schema of a single table) which allows for optimizations.

If you look at the storage engine under the hood you'll see that every table even has it's own directory structure making it clear that a partition from one table will never interact with the partition of another. (see /var/lib/cassandra/)

like image 196
RussS Avatar answered Oct 07 '22 00:10

RussS