Apache Doris 中文技术论坛
Questions Tags Users Badges

【已解决】关于前缀索引,查询的时候where条件顺序一定要和表结构顺序一样吗?

Asked Apr 17, 2024 Modified Apr 19, 2024
Viewed 87
2.0 faq
create table users (`phone` int,`name` varchar, ...)
select ... where name='john' and phone=1212212

这样能匹配到前缀索引优化吗?

edited Apr 19, 2024
____5
asked Apr 17, 2024
1 Answers

如题目中的描述是可以命中前缀索引的,优化器会自动调整过滤条件顺序

如果过滤条件只有name,那么无法命中前缀索引

edited Apr 17, 2024
黄海军@SelectDB5218
answered Apr 17, 2024
Related Questions
各位大哥在通过k8s安装doris3.0的时候,有没有遇到cg启动不起来,提示Set max number of open file descriptors to a value greater than 60000.
1 answers
doris2.0.2.1大量delete语句和stream load执行在5分钟左右
1 answers
doris主键表可以bucket配置太小,怎么修改?
1 answers
flink-doris-connector-1.20.24.0.0 2pc ,checkpoint处恢复数据重复
1 answers
Doris的json解析问题
1 answers
EXPORT 导出cvs 数据为空 导出为\N 怎么修改这个设置
1 answers

Terms of service Privacy policy

Powered by Answer - the open-source software that powers Q&A communities.
Made with love © 2026 Apache Doris 中文技术论坛.