range分区表order by 索引列limit 1 长时间未返回


执行: select *from mars_p1log.logoutrole order by updatetime desc limit 1 \G
耗时:1 row in set (3 hours 16 min 56.07 sec)

如你所言,加了索引列的范围查询后,它不再是TableFulScan而且变为了IndexRangeScan_17,响应时间有所缩短

执行: select *from mars_p1log.logoutrole where updatetime>‘2022-06-30 00:00:00’ order by updatetime desc limit 1 ;
耗时:1 row in set (5 min 11.59 sec)