You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. 标签记录法,使用 `select * from table where id > 10000 limit 10`,
187
+
1. 标签记录法,记录上一页最后一条记录的ID或时间戳,作为下一页的查询条件,使用 `select * from table where id > 10000 limit 10`,
188
188
2. 范围查询,使用 `select * from table where id between 100000 and 100010 order by id desc;`
189
-
3. 使用子查询,把条件转移到主键索引树,使用 `select * from table where id >= (select a.id from table a where a.update_time >= xxx limit 100000, 1) limit 10`
190
-
4. INNER JOIN 延迟关联,与上述的子查询思路类似,将条件转移到主键索引树
191
-
5. 尽量满足索引覆盖
189
+
3. 延迟关联(子查询优化),先通过索引获取主键ID,再关联原表获取完整数据,把条件转移到主键索引树,使用 `select * from table where id >= (select a.id from table a where a.update_time >= xxx limit 100000, 1) limit 10`
0 commit comments