查询按时间过滤遇到的诡异问题 #10754
howardyan93
started this conversation in
General
查询按时间过滤遇到的诡异问题
#10754
Replies: 1 comment 3 replies
-
这个环境还在吗?日志之类的能提供下不可以协助分析下。 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
某一个表test,按datetieme格式的字段ctime进行分区,分区为天。
create table
test
(user_id int,
ctime datetime,
user_name text,
field1 xxx,
field2 xxx,
....
fieldN xxx
) engine=olap
DUPLICATE KEY(
user_id
,ctime
)PARTITION BY RANGE(
ctime
)DISTRUBUTED BY HASH('user_id`) BUCKET10
PROPERTIES (
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unic" = "DAY",
.....
);
在积累到百亿级别的数据的时候,按时间进行查询,出现了timeout:
select * from test where ctime > '2022-07-01 00:00:00' and ctime < '2022-07-02 00:00:00';
但是如果把时间稍微调整一下,加一秒,数据很快就返回了:
select * from test where ctime > '2022-07-01 00:00:01' and ctime < '2022-07-02 00:00:01';
查看了query profile,日志显示完成查询只花了5秒多,但是客户端却没有反映,一直到出现time out错误。
Beta Was this translation helpful? Give feedback.
All reactions