苏童 发表于 2017-12-11 20:17:07

吾生也有涯,而知也无涯

mysql> explain select(select count(*) from article where user_id=1),(select sum(collect_num) from article where user_id=1),(select sum(collect_num) from article where user_id=1);  

+
  
|>  
+
  
|1 | PRIMARY   | NULL    | NULL| NULL                         | NULL                         | NULL    | NULL |    NULL | No tables used         |
  
|4 | SUBQUERY    | article | index | user_id_like_num_collect_num | user_id_like_num_collect_num | 104   | NULL | 3047331 | Using where; Using index |
  
|3 | SUBQUERY    | article | index | user_id_like_num_collect_num | user_id_like_num_collect_num | 104   | NULL | 3047331 | Using where; Using index |
  
|2 | SUBQUERY    | article | index | user_id_like_num_collect_num | user_id_like_num_collect_num | 104   | NULL | 3047331 | Using where; Using index |
  
+
页: [1]
查看完整版本: 吾生也有涯,而知也无涯