http://blog.csdn.net/zhxp_870516/article/details/8434539 http://www.jb51.net/article/49346.htm https://jingyan.baidu.com/article/27fa7326b574e746f8271fb3.html SHOW INDEX…
[[TOC]] 常用操作指令 show databases:显示所有的数据库: use dbName: 使用指定数据库 show tables: 显示所有的数据表: desc tableName: 查看数据表的字段信息: show create table tableName: 查询创建表的所有信息: show create database dbName: 查看数据库创建指令: show full processlist: 查看所有进程 drop table tableName: 删除表 al…
[转]MYSQL索引结构原理.性能分析与优化 第一部分:基础知识 索引 官方介绍索引是帮助MySQL高效获取数据的数据结构.笔者理解索引相当于一本书的目录,通过目录就知道要的资料在哪里, 不用一页一页查阅找出需要的资料. 唯一索引(unique index) 强调唯一,就是索引值必须唯一. 创建索引: create unique index 索引名 on 表名(列名); alter table 表名 add unique index 索引名 (列名); 删除索引: drop index 索引名…
原文:http://tech.meituan.com/mysql-index.html 一个慢查询引发的思考 select count(*) from task where status=2 and operator_id=20839 and operate_time>1371169729 and operate_time<1371174603 and type=2; 系统使用者反应有一个功能越来越慢,于是工程师找到了上面的SQL.并且兴致冲冲的找到了我,“这个SQL需要优化,给我把每个字段都…