explain select vh.aj_id,aj.aj_img,aj.aj_na, count(vh.vh_id)vs_num,count(if((vh.aid=23),1,null)) bol
from ac_jo aj
right join v_hist vh on vh.aj_id = aj.aj_id
where vh.at_id = 1 group by vh.aj_id order by vh.vh_id desc limit 0,50;
部分结果如下:
1 SIMPLE vh ref 5 const 18 Using where; Using temporary; Using filesort
2 1 SIMPLE aj eq_ref PRIMARY PRIMARY 4 对于vh表,temporary, filesort,,,要怎么优化
from ac_jo aj
right join v_hist vh on vh.aj_id = aj.aj_id
where vh.at_id = 1 group by vh.aj_id order by vh.vh_id desc limit 0,50;
部分结果如下:
1 SIMPLE vh ref 5 const 18 Using where; Using temporary; Using filesort
2 1 SIMPLE aj eq_ref PRIMARY PRIMARY 4 对于vh表,temporary, filesort,,,要怎么优化
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货