表里有1200w条数据,根据时间范围来分页查询,效率特别低,耗时100s左右,如何优化呢?查询语句如下
select domain,domainSource,max(dNRegistrationAuthority),max(mark),max(infoType2),max(foundTime),max(created_at) hehe from lk_receive_data_ym
where created_at>='2023-12-26 18:34:48' and created_at<='2024-01-03 18:34:48' group by domain,domainSource order by hehe desc limit 0,10;
其中该时间范围的数据有530W,created_at,domain,domainSource 都加了索引,以下是执行计划
