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 (6,4608,7,4584,4607,4612,4828,4613,5417,4609,4403,4615,4618,4616,4617,5726,4625,4610,4619,4620,4621,4614,4611,4864,5578,4622,4896,4865,5577,5548,4874,4886,4623,5543,4855,4624,4899) GROUPBY vlogs.id ORDERBY avgrating, subs;1.21ms/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261vtdb