1、查看索引:mysql> show index from tblname;

2、利用索引查询:SELECT * FROM product WHERE ID > =(select id from product limit 866613, 1) limit 20

或者

SELECT * FROM product a JOIN (select id from product limit 866613, 20) b ON a.ID = b.id

3、创建单个索引和联合索引

首先创建一个表:create table t1 (id int primary key,username varchar(20),password varchar(20));

创建单个索引的语法:create index 索引名 on 表名(字段名)

索引名一般是:表名_字段名

给id创建索引:create index t1_id on t1(id);

创建联合索引的语法:create index 索引名 on 表名(字段名1,字段名2)

给username和password创建联合索引:create index t1_username_password on t1(username,password)

最新文章

  1. C# Memcache分布式缓存简单入门
  2. 博客建议(Suggestions)
  3. kinect学习笔记(一)—— Openni平台的搭建~、
  4. 通过程序校验xml文档学习笔记
  5. Linux的三种特殊权限
  6. 【AngularJS】AngularJS 教程
  7. 【POJ3182】The Grove BFS 最短路径周围
  8. CRC32 vs Java.HashCode
  9. 在window上安装redis
  10. 十年磨一剑 Delphi重新崛起再写传奇
  11. .net MVC +EF+VUE做回合制游戏(一)
  12. Zepto源码分析之二(新旧版本zepto.Z方法的区别)
  13. centos install redmine (项目管理工具)
  14. C#中foreach命令的使用
  15. Java ,python面向对象的继承及其区别
  16. System.Runtime.InteropServices.COMException:“服务器出现意外情况。 (异常来自
  17. 前端 HTML body标签相关内容 常用标签 定义列表<dl>
  18. 吴裕雄 oracle PL/SQL编程
  19. 交叉编译Python-2.7.13到ARM(aarch64)平台
  20. 学习URL地址(待整理)

热门文章

  1. HTML 学习笔记
  2. ASP.NET中 分析器错误:发现不明确的匹配
  3. Data Types
  4. Hibernate 多对多关联Demo
  5. 花非花-记一次linux上运行时报找不到库函数错误
  6. jquery 插件模版
  7. Primary Expression
  8. 基于Redis的CAS服务端集群
  9. 怎样导入SDWebImage
  10. 关于 mod_python