From b457a44683e688f7a240b5f9bdee6701f3273394 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 20 Dec 2022 01:09:51 -0700 Subject: [PATCH 1/2] Update CommentPipeline, remove expensive reply count re-calculation query --- app/Jobs/CommentPipeline/CommentPipeline.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/Jobs/CommentPipeline/CommentPipeline.php b/app/Jobs/CommentPipeline/CommentPipeline.php index 3d09b3a97..f1470c2a2 100644 --- a/app/Jobs/CommentPipeline/CommentPipeline.php +++ b/app/Jobs/CommentPipeline/CommentPipeline.php @@ -59,14 +59,6 @@ class CommentPipeline implements ShouldQueue $target = $status->profile; $actor = $comment->profile; - if(config('database.default') === 'mysql') { - DB::transaction(function() use($status) { - $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' => $status->id]); - $status->reply_count = count($count); - $status->save(); - }); - } - if ($actor->id === $target->id || $status->comments_disabled == true) { return true; } From efd97d7fa45fce2e978058896ad66652e420425d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 20 Dec 2022 01:10:24 -0700 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47a303228..12c2028a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,8 @@ - Update MediaStorageService, clear MediaService and StatusService caches after localToCloud ([de56b0f0](https://github.com/pixelfed/pixelfed/commit/de56b0f0)) - Add CloudMediaMigrate command to migrate older local media to cloud storage ([382d00d9](https://github.com/pixelfed/pixelfed/commit/382d00d9)) - Update MediaS3GarbageCollector command, handle thumbnail deletion ([95bbcc38](https://github.com/pixelfed/pixelfed/commit/95bbcc38)) +- Update StatusReplyPipeline, remove expensive reply count re-calculation query ([a2f8aad1](https://github.com/pixelfed/pixelfed/commit/a2f8aad1)) +- Update CommentPipeline, remove expensive reply count re-calculation query ([b457a446](https://github.com/pixelfed/pixelfed/commit/b457a446)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)