这段代码占用服务器cup过高,请问如何优化?

2016-07-07 15:22 来源:www.chinab4c.com 作者:ecshop专家



Count: 4955Time=0.00s (0s)Lock=0.00s (0s)Rows=2.0 (9910), cntea[cntea]@[1

16.6.76.126]

SELECT rank_id, IFNULL(mp.user_price, r.discount * N / N) AS price, r.rank_name,

r.discount FROM `cntea`.`ecs_user_rank` AS r LEFT JOIN `cntea`.`ecs_member_pric

e` AS mp ON mp.goods_id = 'S' AND mp.user_rank = r.rank_id WHERE r.show_price = N O

R r.special_rank = N



Count: 4907Time=0.00s (1s)Lock=0.00s (0s)Rows=0.9 (4205), cntea[cntea]@[1

16.6.76.126]

SELECT rank_id, IFNULL(mp.user_price, r.discount * N / N) AS price, r.rank_name,

r.discount FROM `cntea`.`ecs_user_rank` AS r LEFT JOIN `cntea`.`ecs_member_pric

e` AS mp ON mp.goods_id = 'S' AND mp.user_rank = r.rank_id WHERE r.show_price = N O

回答:
顶顶,求解