数组创建倒排索引后,查询速度依旧很慢

Viewed 100

使用doris 2.1.4 版本:
建表语句:
create table test_table (
c1 date not null comment '',
c2 int not null comment '',
c3 varchar(1024) NOT NULL comment '',
c4 array<varchar(15)> comment '',
c5 string comment '',
INDEX index_domain_dns_c4 (c4) USING INVERTED COMMENT '',
INDEX idx_c5 (c5) USING INVERTED PROPERTIES("parser" = "unicode", "support_phrase" = "true", "lower_case" = "true") COMMENT '名称全文检索'
)
UNIQUE KEY(c1, c2, c3)
auto partition by list(c1,c2)()
DISTRIBUTED BY HASH(c3) BUCKETS 5
PROPERTIES (
"replication_num" = "3",
"store_row_column" = "true",
"enable_unique_key_merge_on_write" = "true",
"bloom_filter_columns" = "c3")

查询语句 select count(1) from test_table where array_contains(c4,'a') 这个语句执行比较慢,表有1亿条数据,结果大概有3kw,耗时10s+。使用select count(1) from test_table where c5 match_all 'a' ,该耗时不到1s。

2 Answers

2.0/2.1 array 暂不支持倒排索引查询,3.0 支持表达式下推和array_contains 走倒排索引。

可以直接加我微信 amorynan