---
title: "mysql教程海量数据分页优化代码"
author: "mht19840918"
date: "2011-05-29T15:57:26Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2011-05-29T15:57:59Z"
id: 1063718
url: "https://mht.iteye.com/blog/1063718"
---

page       表示页码
pagesize  表示每页的显示数量
conditon  表示一些条件

SELECT sql_no_cache *FROM table WHERE id>=(SELECTsql_no_cache id FROM table where conditon ORDER BY id DESC LIMIT 126380,1) limit 20;

利用索引优化分页查询