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

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

Asked Apr 17, 2024 Modified Apr 19, 2024
Viewed 61
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
黄海军@SelectDB4868
answered Apr 17, 2024
Related Questions
官方镜像gdb使用报错
left join 报错
doris2.0.15 unique表部分更新出现副本数据不一致
1 answers
doris 2.0.4 某tablet持续base compaction失败重试
1 answers
执行insert into select语句,偶发be与fe连接错误,[THRIFT_RPC_ERROR]Couldn't open transport for 10.1.0.23:9020 (open() timed out)
1 answers
doris 中be节点交替false是什么原因呢
1 answers

Terms of service Privacy policy

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