Open MrKrisKrisu opened 1 month ago
What if we just keep the notifications?
What if we just keep the notifications?
This would not be GDPR compliant, as we would also delete notifications from users who delete their account.
Ah. Right. I forgot about that.
We have a few options to improve this slow query. (Just spitting ideas:)
WITH (NOLOCK)
to delete statements (will not work with sqlite iirc)LIKE "%statusID/userID%
in there, iterate over the results, filter false-positives and delete the rest. This will increase process-time but reduce database-/lock-time.what do you think?
Reduce cost of statement by removing json-queries. We could just slap a LIKE "%statusID/userID% in there
We could even merge both of those where
clauses with an AND
, but I'm not sure if LIKE
wouldn't just also do a full scan which would lock and create similar issues.
Describe the bug
The selective deletion of notifications from the database is very slow, as we work with JSON search parameters here. Another solution must be found here.
Steps to reproduce
https://github.com/Traewelling/traewelling/blob/eca479b3e1b0975cd0f650b65b1dc092204742ee/app/Observers/FollowObserver.php#L14-L17