SELECT vlogs.id as vlog_id, youtube_statistics_subscribercount AS subs, IFNULL(avg(rating), 0) as avgrating_overall, count(*) as count_ratings, IFNULL(avg(rating_credibility), 0) as avgrating_credibility, IFNULL(avg(rating_production), 0) as avgrating_production, IFNULL(avg(rating_entertainment), 0) as avgrating_entertainment, avg(rating+rating_credibility+rating_production+rating_entertainment)/4as avgrating FROM vlogs LEFTJOIN reviews ON vlogs.id=reviews.vlog_id AND reviews.moderation_status=1WHERE vlogs.id IN (4863,4811,4765,4773,4815,4766,4768,5237,4778,5301,4770,4780,4846,4779,5298,4774,5297,4889,4813,4776,4816,4902,4784,4851,4812,4772,4777,4775,4871,4865,4862,5288,4786,4785,4802,4783,4903,4757,4788,4787,4781,4805,4882,4790,4866,4880,4804,4782,4762,4872,4789,4867,4793,4881) GROUPBY vlogs.id ORDERBY avgrating, subs;1.88ms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261vtdb