Remove old SentNotification records constantly
For email notifications of discussions a user is following, we have an unsubscribe link on the email so we can quickly unsubscribe from that thread. For this to work, we create a record in the DB for each email notification we send. So because of this, we have a huge amount of records in the sent_notifications table.
Should we regularly cleanup old sent notification records? I don't think they should be very useful after some time. Setting something up to delete records older than... a year? should be fine? Even if it's more years than that, having a number should make sure we keep this table from growing too fast.
Notes
- The table doesn't have a created_at column. So for existing records we can't know when they were created. If we proceed with this, we would need to give all existing records the current date as
created_atand only be able to delete them after the desired time has passed. - This table is bigger in size than the issues table and has very little information.