explain select `id` from `ao_articles` where (select count(*) from `ao_articles_tags` inner join `ao_articles_relationships` on `ao_articles_tags`.`id` = `ao_articles_relationships`.`tag_id` where `ao_articles_relationships`.`cid` = `ao_articles`.`id` and `id` in (1,2,3,4,5)) >= 1 limit 10000
应该已经添加索引,为什么还会扫描全表?
1
DT27 2016-08-02 16:44:24 +08:00
我一直没搞明白索引。。。帮不了忙~
|
2
huixia0010 2016-08-02 16:49:06 +08:00
count(*) 是全表扫描,自己百度下一目了然~
|