From a2f8aad1d5b9ca77a221dc2e67b377a8858d0ab2 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 20 Dec 2022 01:02:03 -0700 Subject: [PATCH] Update StatusReplyPipeline, remove expensive reply count re-calculation query --- app/Jobs/StatusPipeline/StatusReplyPipeline.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/Jobs/StatusPipeline/StatusReplyPipeline.php b/app/Jobs/StatusPipeline/StatusReplyPipeline.php index 8d8ba36bd..8318179f2 100644 --- a/app/Jobs/StatusPipeline/StatusReplyPipeline.php +++ b/app/Jobs/StatusPipeline/StatusReplyPipeline.php @@ -68,14 +68,6 @@ class StatusReplyPipeline implements ShouldQueue return 1; } - if(config('database.default') === 'mysql') { - DB::transaction(function() use($reply) { - $count = DB::select( DB::raw("select id, in_reply_to_id from statuses, (select @pv := :kid) initialisation where id > @pv and find_in_set(in_reply_to_id, @pv) > 0 and @pv := concat(@pv, ',', id)"), [ 'kid' => $reply->id]); - $reply->reply_count = count($count); - $reply->save(); - }); - } - DB::transaction(function() use($target, $actor, $status) { $notification = new Notification(); $notification->profile_id = $target->id;