建表语句
CREATE TABLE `tbl` (
`a` varchar(64) NULL,
`b` varchar(64) NOT NULL,
`c` varchar(64) NOT NULL,
`d` varchar(20) NOT NULL,
`e` varchar(20) NOT NULL,
...
) ENGINE=OLAP
UNIQUE KEY(`a`, `b`, `c`)
DISTRIBUTED BY HASH(`d`, `a`, `c`) BUCKETS 32
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);
查询如下,目前耗时大概在9s左右
select
a, b, c, d, e,....
from tbl
where d = 'SO1'
and e = 'WO1'
order by a, b, c
limit 5000000, 1000;
前缀索引对于字符串类型的列效果有限
问一下 还有什么办法能够优化这条排序查询