clarkwinkelmann
luceos
Wellwisher
Mariadb slowlog:
# Query_time: 32.984021 Lock_time: 0.014961 Rows_sent: 0 Rows_examined: 14974218
# Rows_affected: 0 Bytes_sent: 0
SET timestamp=1726442872;
delete from `notifications` where `type` in ('discussionRenamed', 'newPost', 'newDiscussionInTag', 'newPostInTag', 'newDiscussionTag', 'byobuPrivateDiscussionCreated', 'byobuPrivateDiscussionReplied', 'byobuRecipientRemoved', 'byobuPrivateDiscussionAdded', 'byobuMadePublic', 'newDiscussionByUser', 'newPostByUser', 'discussionCreated', 'discussionMerged', 'selectBestAnswer', 'awardedBestAnswer', 'bestAnswerInDiscussion', 'discussionLocked') and `subject_id` = 571849;
"The slow query you're facing is a result of examining a large number of rows—over 14 million (Rows_examined: 14974218)—in the notifications table, leading to long query execution times (Query_time: 32.984021). There are a few steps you can take to optimize this query"
How do I fix it?