不同 cassandra 表中的相同分区键加起来是否达到单元格理论限制? [英] Does the same partition key in different cassandra tables add up to cell theoretical limit?
问题描述
众所周知,Cassandra 分区的理论限制为 20 亿个单元.但是在下面这样的情况下它是如何工作的:
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
);
假设我们在 table1 的分区 (some_id = 1) 中有 10 亿个单元格.如果我们在 table2 上的分区 (other_id = 1) 中有另外 10 亿个单元格,这些加起来会达到 20 亿个理论限制吗?
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?
推荐答案
不同的表有不同的分区.这使得任何特定分区的结构都是同质的(它将始终遵循单个表的禁止模式),从而允许优化.
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.
如果您查看引擎盖下的存储引擎,您会发现每个表甚至都有自己的目录结构,这清楚地表明一个表的分区永远不会与另一个表的分区交互.(见/var/lib/cassandra/)
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/)
这篇关于不同 cassandra 表中的相同分区键加起来是否达到单元格理论限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!