【发布时间】:2021-12-14 12:31:44
【问题描述】:
表结构
CREATE TABLE tablename(
col1 text,
col2 text,
col3 timestamp,
col4 timestamp,
col5 text,
col6 timestamp,
.
.
PRIMARY KEY (col5, col6))
WITH CLUSTERING ORDER BY (col6 DESC)
CREATE CUSTOM INDEX indexname on tablename (col1) USING 'StorageAttachedIndex';
CREATE CUSTOM INDEX indexname on tablename (col2) USING 'StorageAttachedIndex';
CREATE CUSTOM INDEX indexname on tablename (col3) USING 'StorageAttachedIndex';
CREATE CUSTOM INDEX indexname on tablename (col4) USING 'StorageAttachedIndex';
CREATE CUSTOM INDEX indexname on tablename (col6) USING 'StorageAttachedIndex';
读取查询:
select col1, col2, col3, col4, col.... from tablename
where col1='text'
and col2='text'
and col3>'timestamp'
and col4>='timestamp'
and col4<='timestamp'
PER PARTITION LIMIT 1;
在 Java 中,我编写了一个代码来执行查询以获取 100,000 条记录,配置如下:
- 执行异步
- Fetch_Size = 10000
- 不使用允许过滤
- DSE - 6.8.9
- Cql - 3.4.5
- 卡桑德拉 - 4.0.0.681
- Java 驱动程序 - 4.6.1
当我运行代码时,它运行良好,并在大约 1 分 20 秒内响应 100,000 行。
但是当我尝试在超过 2 个窗口中并行运行时,只有一个窗口显示结果,其他窗口抛出超时错误。
一致性 ONE 读取查询期间 Cassandra 超时
【问题讨论】:
标签: cassandra datastax cql datastax-enterprise datastax-java-driver