下面我们为表t2创建一个索引:
[SQL] 纯文本查看 复制代码
001
002
003
004
005
006
007
008
009
010
011
|
mysql> create index in_id on t2(id); Query OK, 0 rows affected (0.01 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> show index from t2; + -------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | + -------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | t2 | 1 | in_id | 1 | id | A | NULL | NULL | NULL | YES | BTREE | | + -------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ 1 row in set (0.00 sec) |
并插入1000万行的数据。
然后再用:
[SQL] 纯文本查看 复制代码
001
|
explain select * from t2 where id=1; |
或者
[SQL] 纯文本查看 复制代码
001
|
desc select * from t2 where id=1; |
查询其影响行数。决定其是否需要优化
http://www.sodu666.com/ZhuShenQi/
http://tieba.sodu666.com/
IOS开发-第三方SDWebImage下载网络图片的使用
解决TalbleView头部或底部子控件不显示问题
node.js http.get 和http.post 数据
Node.js Express 获取request原始数据
个人开发者做一款Android App需要知道的事情
个人开发者的酸甜苦辣
码农的福利来了, 编程在线Androd 客户端上线了
console使用技巧
AngularJS 常用语法