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量级数据表的分页优化方案的主要内容,如果未能解决你的问题,请参考以下文章

彻底搞明白大数据量下Mysql的分页优化

MySQL的分页优化

jsp与mysql的分页

MySQL带排序的分页查询优化

Mysql的分页查询优化

在mysql 数据库下,基于sql 语言的分页语句