Cassandra LIMIT 1 未优化

问题描述 投票:0回答:1
CREATE TABLE IF NOT EXISTS details (
    public_id text,
    updated_at timeuuid,
    details text,
    PRIMARY KEY (public_id, updated_at)
) WITH CLUSTERING ORDER BY (updated_at DESC)
AND comment='A table to hold details update history'

public_id - PartitionKey - 字符串(uuid)
updatedAt - clusteringKey - timeuuid
详细信息 - json,大小范围从 1KB - 4 KB

查询 -

select * from details where public_id = 'prefix_4758a709fae94c87a84ea89623037577' limit 1;

我看了这篇文章 - https://thelastpickle.com/blog/2017/03/07/The-limit-clause-in-cassandra-might-not-work-as-you-think.html

正如文章提到的,这个问题已在 3.4 中修复 - https://issues.apache.org/jira/browse/CASSANDRA-8180

我的版本 - Cassandra 4.0.5

但是查看下面的跟踪输出,它似乎不起作用,如您所见

Merged data from memtables and 19 sstables

Merged data from memtables and 21 sstables

这里正在跟踪另一个分区

  • 推测重试 3 个节点
  • 总共 RF 3 和 CL= LOCAL_QUORUM,6 个节点被击中,奇怪

cassandra limit
1个回答
0
投票

https://issues.apache.org/jira/browse/CASSANDRA-19345 看起来,回归并失去了 CASSANDRA-8180 的优化

© www.soinside.com 2019 - 2024. All rights reserved.