怎么进行mysql量级数据表的分页优化
怎么进行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;
实现步骤:
1.获取start_id
select id as start_id from yundou_v3.bill_info order by id asc limit n*page_size ,1
2.获取start_id后面的n条数据
SELECT * FROM yundou_v3.bill_info WHERE id>= “start_id” limit 20;
看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注创新互联行业资讯频道,感谢您对创新互联的支持。
网站栏目:怎么进行mysql量级数据表的分页优化
分享链接:http://ybzwz.com/article/gedccp.html