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 (5154,4703,4705,4747,4704,4841,4745,4708,4706,4712,4707,4748,4743,5184,4710,4746,4729,4716,4718,4730,4720,4838,5982,4744,4728,4724,4741,4839,4732,4738,6000) GROUPBY vlogs.id ORDERBY avgrating, subs;1.11ms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261vtdb