ITPub博客

首页 > 数据库 > MySQL > 一个简单的limit优化

一个简单的limit优化

原创 MySQL 作者:yleizzz 时间:2017-04-14 15:18:28 0 删除 编辑


# limit 默认以主键进行排序
# 如果有order by 以 orderby的内容作为排序
#如果 没有order by 以sql的索引排序规则为 limit 排序
select id,title from collect limit 90000,10;


select id,title from collect where id>=(select id from collect order by id limit 90000,1) limit 10; 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30127122/viewspace-2137281/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: mysql 读锁及写锁
请登录后发表评论 登录
全部评论

注册时间:2015-02-03

  • 博文量
    101
  • 访问量
    184276