mysql 大数据表 order by + limit 导致查询缓慢问题
数据表有200万行,单表分页查询,当offset 2002470 很大的时候 加上 order by 很慢很慢
sql:
SELECTtable1
.id
FROMtable1
INNER JOIN table2
ON table1
.id
= table2
.id
ORDER BYstart_time
DESC
LIMIT 1 OFFSET 2002470
其中start_time是普通索引
有没有好的办法优化的?
推荐文章: