mysql量级数据表的分页优化方案
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql量级数据表的分页优化方案相关的知识,希望对你有一定的参考价值。
前言
Limit分页通用方案
select * from yundou_v3.bill_info limit 100,20;
select * from yundou_v3.bill_info limit 400000,20;
select * from yundou_v3.bill_info limit 600000,20;
select * from yundou_v3.bill_info limit 800000,20;
select * from yundou_v3.bill_info limit 1000000,20;
量级数据分页方案
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 100,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 400000,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 600000,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 800000,1
) limit 20;
SELECT * FROM yundou_v3.bill_info WHERE id>= (
select id as id from yundou_v3.bill_info order by id asc limit 1000000,1
) limit 20;
以上是关于mysql量级数据表的分页优化方案的主要内容,如果未能解决你的问题,请参考以下文章