cassandra - Cassandra 的“system.size_estimates”没有显示大小
问题描述
我在 Cassandra 中有一个表,其中包含超过 20 亿条记录(最大 int 值),但分区不充分。认为:
> create table if not exists bar (
bar_id bigint,
col_a text,
col_b text,
col_c int,
col_d text,
primary key (bar_id, col_a, col_b, col_c))
我已经刷新了大小估计,nodetool refreshsizeestimates
我可以看到数据很好,但所有行都在同一个标记下:
> select col_a, col_b, col_c from foo.bar where bar_id = 1;
col_a | col_b | col_c
--------+-------+--------
aaaaaa | b | 0
aaaaaa | bb | 1
aaaaaa | bb | 2
aaaaaa | bbb | 1
> select col_a, col_b, col_c
from foo.bar
where bar_id = 1
and token(crawl_id) < 6121040252107678107
and token(crawl_id) > 6121040252107678107;
col_a | col_b | col_c
--------+-------+--------
(0 rows)
然而,分区大小显示为零:
> select * from system.size_estimates
where keyspace_name = 'foo' and table_name = 'bar';
keyspace_name | table_name | range_start | range_end | mean_partition_size | partitions_count
---------------+-------------+---------------------+---------------------+---------------------+------------------
foo | bar | 6038186684182191258 | 6054588198651336225 | 0 | 0
foo | bar | 6892562529594743760 | 6908565156302797782 | 0 | 0
foo | bar | 6944218160728667924 | 6944876930711291150 | 0 | 0
...
密钥空间复制设置为 1。
> create keyspace foo
with replication = {'class': 'NetworkTopologyStrategy', 'south': '1'} and durable_writes = true;
如何获得整个或每个分区的正确大小或有关令牌/数据的任何信息?
$ nodetool tablehistograms -- foo bar
foo/bar histograms
Percentile SSTables Write Latency Read Latency Partition Size Cell Count
(micros) (micros) (bytes)
50% 20.00 0.00 155469.30 8582860529 129557750
75% 20.00 0.00 186563.16 158683580810 268650950
95% 20.00 0.00 186563.16 568591960032 1996099046
98% 20.00 0.00 186563.16 568591960032 1996099046
99% 20.00 0.00 186563.16 568591960032 1996099046
Min 18.00 0.00 129557.75 268650951 0
Max 20.00 0.00 186563.16 568591960032 1996099046
卡桑德拉版本3.11.2
。
解决方案
推荐阅读
- java - 我应该抛出什么异常来返回与使用@Valid 时得到的相同的错误请求响应?
- bar-chart - altair - 将刻度线与条形图中的条形中心对齐
- mongodb - 在mongodb中使用limit时如何获取匹配文档的真实数量?
- android - 如何使用屏幕尺寸缩放materialalertdialog?
- ios - 为什么 CALayer 蒙版没有居中并偏离几个像素?
- javascript - 如何使用 tspan 对文本使用退出选择
- python - 初始化一行二维数组初始化整个二维数组
- java - 调用类中的方法,继承
- amazon-web-services - 如何使用 HTTP 为 Common Crawl News Dataset 获取 WARC 文件列表?
- python - 为什么我得到未解决的对 unicode 和 xrange 的引用