摘要: explain显示了mysql如何使用索引来处理select语句以及连接表。可以帮助选择更好的索引和写出更优化的查询语句。使用方法,在select语句前加上explain就可以了:如:explainselectsurname,first_nameforma,bwherea.id=b.idEXPLAI... 阅读全文
posted @ 2015-05-20 17:13 系统攻城狮 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1.使用explain语句查看性能mysql> explain select product_id from orders where order_id in (123, 312, 223, 132, 224) \G2.为什么要创建组合索引呢?如果只有一个索引,2个查询条件的语句中会先去索引查询一个... 阅读全文
posted @ 2015-05-20 17:03 系统攻城狮 阅读(250) 评论(0) 推荐(0) 编辑