You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current .cleanup_read_marks! appears to iterate over every entry in the table, checking for older entries, and then deleting all but the newest. This could result in a lot of un-used find queries where there are no read marks that need to be cleaned for a certain readable. It seems like it could be optimized by having a query with some sort of WHERE COUNT(read_marks.id) > 1 GROUP BY readable_id, readable_type, which would only then iterate over things that actually needed cleaning.
The text was updated successfully, but these errors were encountered:
The current
.cleanup_read_marks!
appears to iterate over every entry in the table, checking for older entries, and then deleting all but the newest. This could result in a lot of un-used find queries where there are no read marks that need to be cleaned for a certainreadable
. It seems like it could be optimized by having a query with some sort ofWHERE COUNT(read_marks.id) > 1 GROUP BY readable_id, readable_type
, which would only then iterate over things that actually needed cleaning.The text was updated successfully, but these errors were encountered: