2020年7月3日
摘要: 1、分类 MySQL索引分为普通索引、唯一索引、主键索引、组合索引、全文索引。 索引不会包含有null值的列,索引项可以为null(唯一索引、组合索引等),但是只要列中有null值就不会被包含在索引中。 (0)创建表: create table test( id1 int , id2 int, id 阅读全文
posted @ 2020-07-03 11:17 幂次方 阅读(272) 评论(0) 推荐(0)
摘要: explain字段解释 EXPLAIN列的解释: table:显示这一行的数据是关于哪张表的 type:这是重要的列,显示连接使用了何种类型。从最好到最差的连接类型为const、eq_reg、ref、range、indexhe和ALL possible_keys:显示可能应用在这张表中的索引。如果为 阅读全文
posted @ 2020-07-03 11:15 幂次方 阅读(966) 评论(0) 推荐(0)
摘要: create table test( id1 int , id2 int, id3 int, id4 int, key index_id12(id1,id2)); 用到索引explain select * from test where id1 < 10;用到索引explain select * f 阅读全文
posted @ 2020-07-03 11:00 幂次方 阅读(455) 评论(0) 推荐(0)