关于联合索引,范围查询,时间列索引的几个问题
【b_c】与【c】是否适合同时存在
查询语句:
1. select * from demo where b=1 and c=2
2. select * from demo where c=2
in 查询里有一段是连续的,一段是不连续的,查询优化器是否会做部分【顺序io】
select * from demo where b in (1,2,3,4,5,6,10,30,50)
对于连续的部分 1,2,3,4,5,6 是否会做 【顺序io】
时间列是否适合做索引
select * from demo
where type=0
and created_at > '2020-10-10 10:10:10' and created_at < '2020-10-11 10:10:10'
order by created_at desc
limit 15
时间列经常作为额外的筛选条件,这句语句我应该怎么打索引,以及优化
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: