mysql创建索引及expain检查索引效率

创建索引规则:https://www.cnblogs.com/helloworldlx/p/8651583.html

explain检查索引的结果:https://blog.csdn.net/dennis211/article/details/78170079

感觉写的很实用

打算用一下

记录下我的使用,根据源博客说的,我选择了给多个字段加索引,加索引的代码如下

#添加索引
ALTER TABLE table_name ADD INDEX query_index (tained_id, is_group, send_time)

然后使用explain检验

explain select * from table_name where tained_id =42 and is_group=0 ORDER BY send_time ASC

结果如下

附上源博客的截图:

 

猜你喜欢

转载自blog.csdn.net/luo_yu_1106/article/details/90669701