关于mysql 关联查询索引问题

浏览:633 发布日期:2016/09/08 分类:求助交流 关键字: mysql php
mysql> explain SELECT d.IndexID,d.title,d.PublishDate,d.ReadNum,d.LikeNum FROM weitoutiao_cms.cmsw_publish_article_detail d LEFT JOIN weitoutiao_cms.cmsw_publish_article p ON p.IndexID=d.IndexID WHERE d.Author ='112867' order by p.order_hot desc limit 5;

| 1 | SIMPLE | d | ref | author_date_title | author_date_title | 62 | const | 21 | Using where; Using temporary; Using filesort |
| 1 | SIMPLE | p | eq_ref | PRIMARY | PRIMARY | 4 | weitoutiao_cms.d.IndexID | 1 | |


p.order_hot 为第二个表 是有索引的字段 为什么执行这条SQL 会查出 用到 temporary; Using filesort
最佳答案
评论( 相关
后面还有条评论,点击查看>>