在使用limit的offset比较大的时候,使用子查询优化sql,减小回表操做

在使用limit的offset比较大的时候,好比 从offeset=30000开始取5条数据 select * from t where a = ‘11’ limit 30000,5mysql 有一张财务流水表,未分库分表,目前的数据量为9555695,分页查询使用到了limit,优化以前的查询耗时16 s 938 ms (execution: 16 s 831 ms, fetching: 107
相关文章
相关标签/搜索