【详述】同一个表,同一个sql,加上索引后查询速度反而慢了
【背景】对一个主键表,加上bitmap索引,并在where中使用该字段过滤数据
【业务影响】
【StarRocks版本】1.19.5
【集群规模】例如:3fe (3follower) +3be
【机器信息】16c 32G
【附件】
有索引的Profile.log (26.8 KB)
没有索引的profile.log (26.8 KB)
ddl.log (13.6 KB)
sql
– 117ms 没索引
select count(1) from core_order where createdon between ‘2019-01-01’ and ‘2019-01-05’ ;
– 250ms 有bitmap索引
select count(1) from core_order2 where createdon between ‘2019-01-01’ and ‘2019-01-05’ ;