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

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

Asked Apr 17, 2024 Modified Apr 19, 2024
Viewed 103
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
doris集群迁移,doris2.1.6迁移到doris4.1.3,CCR哪个版本能支持?
1 answers
调用Doris数据时报数据块损坏,根据官网解决方案排查,所有节点分片均正常,调用时还是会报错,doris版本为2.1.7
2 answers
doris2.0.7集群迁移到新搭建的doris2.1.11集群
1 answers
Doris Routine Load重置offset
1 answers
Alter routine load后参数变动
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 中文技术论坛.